mirror of
https://github.com/godotengine/godot.git
synced 2026-05-12 22:35:35 +00:00
[macOS] Enable wake for events if Magnet is running.
This commit is contained in:
@@ -61,7 +61,14 @@
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
void OS_MacOS::add_frame_delay(bool p_can_draw, bool p_wake_for_events) {
|
||||
if (p_wake_for_events) {
|
||||
bool wake_for_events = p_wake_for_events;
|
||||
if (!wake_for_events) {
|
||||
NSArray<NSRunningApplication *> *proc_array = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.crowdcafe.windowmagnet"];
|
||||
if (proc_array && proc_array.count > 0) {
|
||||
wake_for_events = true;
|
||||
}
|
||||
}
|
||||
if (wake_for_events) {
|
||||
uint64_t delay = get_frame_delay(p_can_draw);
|
||||
if (delay == 0) {
|
||||
return;
|
||||
@@ -79,7 +86,7 @@ void OS_MacOS::add_frame_delay(bool p_can_draw, bool p_wake_for_events) {
|
||||
CFRunLoopAddTimer(CFRunLoopGetCurrent(), wait_timer, kCFRunLoopCommonModes);
|
||||
return;
|
||||
}
|
||||
OS_Unix::add_frame_delay(p_can_draw, p_wake_for_events);
|
||||
OS_Unix::add_frame_delay(p_can_draw, wake_for_events);
|
||||
}
|
||||
|
||||
void OS_MacOS::initialize() {
|
||||
|
||||
Reference in New Issue
Block a user