From 425d8302b44137234e83d62edb70754d114b5cba Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 30 Dec 2021 10:16:45 +0100 Subject: [PATCH] Only restore level if it is wrong 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index bf04aad2..cd1da5b5 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -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()) -- 2.39.5