aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorHugo Lundin <hugo@lundin.dev>2021-07-15 13:32:19 +0200
committerHugo Lundin <hugo@lundin.dev>2021-07-16 16:09:46 +0200
commita182475db57b3da5edf3d10542086397ee022dcd (patch)
treee997801ded31217a9a9b21f40151fe02717a7bdb /vncviewer
parent0d43b96d1c2385fc8202462cf170d7ac7da5d2f7 (diff)
downloadtigervnc-a182475db57b3da5edf3d10542086397ee022dcd.tar.gz
tigervnc-a182475db57b3da5edf3d10542086397ee022dcd.zip
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.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/DesktopWindow.cxx7
1 files 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;