diff options
author | Yevgeny Makarov <jenkm> | 2020-01-31 20:33:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-31 20:40:45 +0300 |
commit | 57801426792c3ca9c126c3c720ca6f337815294c (patch) | |
tree | 56399665471b38818f610cba62173b3ad1eb43b6 /intern | |
parent | 4f8f0f3208b51fd2c599917415dcfaa3cf424d5f (diff) |
Fix T64024: fullscreen switching on macOS shows red line artifacts
Specifically, this happened when automatically hiding and showing of the
menu bar and dock was enabled in the system preferences.
Differential Revision: https://developer.blender.org/D6710
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 43e35faf808..41163239a2b 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -94,6 +94,12 @@ - (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 @@ -109,6 +115,10 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { associatedWindow->setImmediateDraw(false); + /* See comment for windowWillEnterFullScreen. */ + if ([(NSWindow *)associatedWindow->getOSWindow() isZoomed]) { + systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); + } } - (void)windowDidResize:(NSNotification *)notification |