Skip to content

Commit

Permalink
Merge pull request #79572 from bruvzg/mac_bg_ws_sync
Browse files Browse the repository at this point in the history
[macOS] Fix uncapped frame rate for windows in the non-active workspaces.
  • Loading branch information
YuriSizov committed Jul 18, 2023
2 parents 77d96b2 + 2ee45dc commit ec66c53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3256,14 +3256,14 @@
}

bool DisplayServerMacOS::window_can_draw(WindowID p_window) const {
return window_get_mode(p_window) != WINDOW_MODE_MINIMIZED;
return (window_get_mode(p_window) != WINDOW_MODE_MINIMIZED) && [windows[p_window].window_object isOnActiveSpace];
}

bool DisplayServerMacOS::can_any_window_draw() const {
_THREAD_SAFE_METHOD_

for (const KeyValue<WindowID, WindowData> &E : windows) {
if (window_get_mode(E.key) != WINDOW_MODE_MINIMIZED) {
if ((window_get_mode(E.key) != WINDOW_MODE_MINIMIZED) && [E.value.window_object isOnActiveSpace]) {
return true;
}
}
Expand Down

0 comments on commit ec66c53

Please sign in to comment.