Skip to content

Commit

Permalink
Don't touch macOS window level if not shown
Browse files Browse the repository at this point in the history
Otherwise there isn't any system window to examine or modify.
  • Loading branch information
CendioOssman committed Feb 6, 2025
1 parent 03ebc9b commit 1280c71
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions vncviewer/DesktopWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1057,14 +1057,17 @@ void DesktopWindow::fullscreen_on()
}
#ifdef __APPLE__
// This is a workaround for a bug in FLTK, see: https://github.com/fltk/fltk/pull/277
int savedLevel;
savedLevel = cocoa_get_level(this);
int savedLevel = -1;
if (shown())
savedLevel = cocoa_get_level(this);
#endif
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
if (cocoa_get_level(this) != savedLevel)
cocoa_set_level(this, savedLevel);
if (savedLevel != -1) {
if (cocoa_get_level(this) != savedLevel)
cocoa_set_level(this, savedLevel);
}
#endif

if (!fullscreen_active())
Expand Down

0 comments on commit 1280c71

Please sign in to comment.