[Bf-blender-cvs] [bf361fc9a00] master: Fix T64024: monitor/fullscreen switching on macOS shows red line artifacts

Yevgeny Makarov noreply at git.blender.org
Tue Feb 11 15:34:47 CET 2020


Commit: bf361fc9a00cdbbf5956e402b92b7b092a3aa654
Author: Yevgeny Makarov
Date:   Tue Feb 11 15:06:48 2020 +0100
Branches: master
https://developer.blender.org/rBbf361fc9a00cdbbf5956e402b92b7b092a3aa654

Fix T64024: monitor/fullscreen switching on macOS shows red line artifacts

===================================================================

M	intern/ghost/intern/GHOST_WindowCocoa.mm

===================================================================

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;



More information about the Bf-blender-cvs mailing list