diff options
author | Pierre Ossman <ossman@cendio.se> | 2025-02-08 14:09:54 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2025-02-08 14:09:54 +0100 |
commit | afdbbcc44f5e140f64b0de4cc3eff9be3b5142d4 (patch) | |
tree | e1edcca88fdd5835b83322f9a15d6de4001b475c | |
parent | 1280c7176cdd607b06beae0f16e79e1ceefe7410 (diff) | |
download | tigervnc-afdbbcc44f5e140f64b0de4cc3eff9be3b5142d4.tar.gz tigervnc-afdbbcc44f5e140f64b0de4cc3eff9be3b5142d4.zip |
Don't enable full screen until MapNotify
Modern mutter (GNOME's window manager) has an internal race condition
where changing state early is unreliable. Waiting for the MapNotify
seems to get us past the unreliable zone.
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 2bf63b8f..d54a92b3 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -222,14 +222,6 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name, // Adjust layout now that we're visible and know our final size repositionWidgets(); - if (delayedFullscreen) { - // Hack: Fullscreen requests may be ignored, so we need a timeout for - // when we should stop waiting. We also really need to wait for the - // resize, which can come after the fullscreen event. - Fl::add_timeout(0.5, handleFullscreenTimeout, this); - fullscreen_on(); - } - // Throughput graph for debugging if (vlog.getLevel() >= LogWriter::LEVEL_DEBUG) { memset(&stats, 0, sizeof(stats)); @@ -947,6 +939,19 @@ int DesktopWindow::fltkDispatch(int event, Fl_Window *win) } break; + case FL_SHOW: + // In this particular place, FL_SHOW means an actual MapNotify, + // which means we can continue enabling initial fullscreen. + if (dw->delayedFullscreen) { + // Hack: Fullscreen requests may be ignored, so we need a + // timeout for when we should stop waiting. We also really need + // to wait for the resize, which can come after the fullscreen + // event. + Fl::add_timeout(0.5, handleFullscreenTimeout, dw); + dw->fullscreen_on(); + } + break; + case FL_RELEASE: // We usually fail to grab the mouse if a mouse button was // pressed when we gained focus (e.g. clicking on our window), |