summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/os_osx.h2
-rw-r--r--platform/osx/os_osx.mm14
2 files changed, 16 insertions, 0 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index 9423b6e1d6..eecffa5c62 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -205,6 +205,8 @@ public:
virtual bool is_window_minimized() const;
virtual void set_window_maximized(bool p_enabled);
virtual bool is_window_maximized() const;
+ virtual void set_window_always_on_top(bool p_enabled);
+ virtual bool is_window_always_on_top() const;
virtual void request_attention();
virtual String get_joy_guid(int p_device) const;
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 852e9834d4..bb48ae991d 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1891,6 +1891,20 @@ void OS_OSX::move_window_to_foreground() {
[window_object orderFrontRegardless];
}
+void OS_OSX::set_window_always_on_top(bool p_enabled) {
+ if (is_window_always_on_top() == p_enabled)
+ return;
+
+ if (p_enabled)
+ [window_object setLevel:NSFloatingWindowLevel];
+ else
+ [window_object setLevel:NSNormalWindowLevel];
+}
+
+bool OS_OSX::is_window_always_on_top() const {
+ return [window_object level] == NSFloatingWindowLevel;
+}
+
void OS_OSX::request_attention() {
[NSApp requestUserAttention:NSCriticalRequest];