From 2c1a74fb3a8aac2d8d8a7050b890aa780a5f0356 Mon Sep 17 00:00:00 2001 From: GungnirInd Date: Thu, 21 Jul 2016 08:30:20 -0700 Subject: [PATCH] Implement OS.request_attention() for OSX (#5662) Keeps bouncing icon until user focuses window --- platform/osx/os_osx.h | 2 +- platform/osx/os_osx.mm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index e1c33cb0180..8f89695a68f 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -202,7 +202,7 @@ public: virtual bool is_window_minimized() const; virtual void set_window_maximized(bool p_enabled); virtual bool is_window_maximized() const; - + virtual void request_attention(); void run(); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 45c500ec393..dc87f767f67 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1577,6 +1577,11 @@ void OS_OSX::move_window_to_foreground() { [window_object orderFrontRegardless]; } +void OS_OSX::request_attention() { + + [NSApp requestUserAttention:NSCriticalRequest]; +} + String OS_OSX::get_executable_path() const { int ret;