From a182475db57b3da5edf3d10542086397ee022dcd Mon Sep 17 00:00:00 2001 From: Hugo Lundin Date: Thu, 15 Jul 2021 13:32:19 +0200 Subject: [PATCH] Explicitly choose current monitor There are no guarantees from the WM that calling `fullscreen_screens` with all monitor indices set to `-1` results in the window's current monitor being used. Because FullScreenMode uses the word "current" we want to explicitly ask the WM to use that monitor. --- vncviewer/DesktopWindow.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 0b957d39..0fe08707 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -885,9 +885,10 @@ void DesktopWindow::fullscreen_on() bool all_monitors = !strcasecmp(fullScreenMode, "all"); bool selected_monitors = !strcasecmp(fullScreenMode, "selected"); - if (not selected_monitors and not all_monitors) - fullscreen_screens(-1, -1, -1, -1); - else { + if (not selected_monitors and not all_monitors) { + int n = Fl::screen_num(x(), y(), w(), h()); + fullscreen_screens(n, n, n, n); + } else { int top, bottom, left, right; int top_y, bottom_y, left_x, right_x; -- 2.39.5