From: Hugo Lundin Date: Thu, 15 Jul 2021 11:32:19 +0000 (+0200) Subject: Explicitly choose current monitor X-Git-Tag: v1.11.90~25^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a182475db57b3da5edf3d10542086397ee022dcd;p=tigervnc.git 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. --- 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;