diff options
author | Yevgeny Makarov <jenkm> | 2020-02-11 17:06:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-11 17:30:30 +0300 |
commit | bf361fc9a00cdbbf5956e402b92b7b092a3aa654 (patch) | |
tree | 981c42fb0bbefac935c7a61a616082ea0036e1fc /intern | |
parent | 804e90b42d728ecb1073af8d0bae15a91b13a469 (diff) |
Fix T64024: monitor/fullscreen switching on macOS shows red line artifacts
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 8c86d92bf75..c40b6445348 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -94,16 +94,15 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification { associatedWindow->setImmediateDraw(true); - /* macOS does not send a window resize event when switching between zoomed - * and fullscreen, when automatic show/hide of dock and menu bar are enabled. - * Send our own to prevent artifacts. */ - if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { - systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); - } } - (void)windowDidEnterFullScreen:(NSNotification *)notification { + /* macOS does not send a window resize event when switching between zoomed + * and fullscreen, when automatic show/hide of dock and menu bar are enabled. + * Send our own to prevent artifacts. */ + systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); + associatedWindow->setImmediateDraw(false); } @@ -114,11 +113,9 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { - associatedWindow->setImmediateDraw(false); /* See comment for windowWillEnterFullScreen. */ - if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { - systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); - } + systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); + associatedWindow->setImmediateDraw(false); } - (void)windowDidResize:(NSNotification *)notification @@ -137,6 +134,7 @@ - (void)windowDidChangeBackingProperties:(NSNotification *)notification { systemCocoa->handleWindowEvent(GHOST_kEventNativeResolutionChange, associatedWindow); + systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); } - (BOOL)windowShouldClose:(id)sender; |