[Bf-blender-cvs] [57801426792] blender-v2.82-release: Fix T64024: fullscreen switching on macOS shows red line artifacts
Yevgeny Makarov
noreply at git.blender.org
Fri Jan 31 18:42:51 CET 2020
Commit: 57801426792c3ca9c126c3c720ca6f337815294c
Author: Yevgeny Makarov
Date: Fri Jan 31 18:33:36 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB57801426792c3ca9c126c3c720ca6f337815294c
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
===================================================================
M intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
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
More information about the Bf-blender-cvs
mailing list