diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-09 12:30:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-09 12:30:17 +0200 |
commit | 846e7bbc53931df81bfdcda77035b01edcfa42c1 (patch) | |
tree | 05c8745916a0782564d9246f6dc9a0a501afa799 /platform/osx/os_osx.mm | |
parent | def6655964d0ae3a3c9f2d668efef58777ac62e6 (diff) | |
parent | 7c7182483f50edae81f92bd4d4ad627f1b3ca57c (diff) |
Merge pull request #27490 from bruvzg/macos_non_resizable_fullscreen
Allow non-resizeable windows to enter full-screen mode.
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r-- | platform/osx/os_osx.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 7d2116ba7e..4bbe30a7d1 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -271,6 +271,8 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt - (void)windowDidExitFullScreen:(NSNotification *)notification { OS_OSX::singleton->zoomed = false; + if (!OS_OSX::singleton->resizable) + [OS_OSX::singleton->window_object setStyleMask:[OS_OSX::singleton->window_object styleMask] & ~NSWindowStyleMaskResizable]; } - (void)windowDidChangeBackingProperties:(NSNotification *)notification { @@ -2300,6 +2302,8 @@ void OS_OSX::set_window_fullscreen(bool p_enabled) { if (zoomed != p_enabled) { if (layered_window) set_window_per_pixel_transparency_enabled(false); + if (!resizable) + [window_object setStyleMask:[window_object styleMask] | NSWindowStyleMaskResizable]; [window_object toggleFullScreen:nil]; } zoomed = p_enabled; @@ -2314,7 +2318,7 @@ void OS_OSX::set_window_resizable(bool p_enabled) { if (p_enabled) [window_object setStyleMask:[window_object styleMask] | NSWindowStyleMaskResizable]; - else + else if (!zoomed) [window_object setStyleMask:[window_object styleMask] & ~NSWindowStyleMaskResizable]; resizable = p_enabled; |