]> source.dussan.org Git - tigervnc.git/commitdiff
Only restore level if it is wrong
authorPierre Ossman <ossman@cendio.se>
Thu, 30 Dec 2021 09:16:45 +0000 (10:16 +0100)
committerPierre Ossman <ossman@cendio.se>
Thu, 30 Dec 2021 09:16:45 +0000 (10:16 +0100)
Tweak the workaround from 9023a2e so that it only triggers if there
actually is a problem to fix. This is important since changing levels
also has the side effect of raising the window to the top of the level.

vncviewer/DesktopWindow.cxx

index bf04aad2cd8c3d0ba29a137e1ffaeebb69a9b8c8..cd1da5b58bae1c2dbc1cea9f2bad78145cd6babd 100644 (file)
@@ -992,7 +992,8 @@ void DesktopWindow::fullscreen_on()
   fullscreen_screens(top, bottom, left, right);
 #ifdef __APPLE__
   // This is a workaround for a bug in FLTK, see: https://github.com/fltk/fltk/pull/277
-  cocoa_set_level(this, savedLevel);
+  if (cocoa_get_level(this) != savedLevel)
+    cocoa_set_level(this, savedLevel);
 #endif
 
   if (!fullscreen_active())