aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2021-10-06 15:40:24 +0200
committerGitHub <noreply@github.com>2021-10-06 15:40:24 +0200
commit468687f5d7f036b3e78e767b32d3b9b14a4b3b17 (patch)
tree44d19721ac5901eb5e80370dd6de7bb126b22a00 /vncviewer
parentab8aa4634efc4935d9ff1df85105ea76bfdff5be (diff)
parent9023a2ec1823d473f1cfe0b723c8636d8e994e2c (diff)
downloadtigervnc-468687f5d7f036b3e78e767b32d3b9b14a4b3b17.tar.gz
tigervnc-468687f5d7f036b3e78e767b32d3b9b14a4b3b17.zip
Merge pull request #1349 from samhed/fullscreenLevel
Workaround FLTK bug that causes OptionsDialog to appear behind DesktopWindow
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/DesktopWindow.cxx16
-rw-r--r--vncviewer/cocoa.h3
-rw-r--r--vncviewer/cocoa.mm14
3 files changed, 29 insertions, 4 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index d379a712..f334c614 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -918,12 +918,11 @@ void DesktopWindow::fullscreen_on()
{
bool allMonitors = !strcasecmp(fullScreenMode, "all");
bool selectedMonitors = !strcasecmp(fullScreenMode, "selected");
+ int top, bottom, left, right;
if (not selectedMonitors and not allMonitors) {
- int n = Fl::screen_num(x(), y(), w(), h());
- fullscreen_screens(n, n, n, n);
+ top = bottom = left = right = Fl::screen_num(x(), y(), w(), h());
} else {
- int top, bottom, left, right;
int top_y, bottom_y, left_x, right_x;
int sx, sy, sw, sh;
@@ -983,8 +982,17 @@ void DesktopWindow::fullscreen_on()
}
}
- 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
+ int savedLevel;
+ 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
+ cocoa_set_level(this, savedLevel);
+#endif
if (!fullscreen_active())
fullscreen();
diff --git a/vncviewer/cocoa.h b/vncviewer/cocoa.h
index 08340038..ca17ddf9 100644
--- a/vncviewer/cocoa.h
+++ b/vncviewer/cocoa.h
@@ -21,6 +21,9 @@
class Fl_Window;
+int cocoa_get_level(Fl_Window *win);
+void cocoa_set_level(Fl_Window *win, int level);
+
int cocoa_capture_displays(Fl_Window *win);
void cocoa_release_displays(Fl_Window *win);
diff --git a/vncviewer/cocoa.mm b/vncviewer/cocoa.mm
index dca1afa4..e8764f52 100644
--- a/vncviewer/cocoa.mm
+++ b/vncviewer/cocoa.mm
@@ -50,6 +50,20 @@ const int kVK_Menu = 0x6E;
static bool captured = false;
+int cocoa_get_level(Fl_Window *win)
+{
+ NSWindow *nsw;
+ nsw = (NSWindow*)fl_xid(win);
+ return [nsw level];
+}
+
+void cocoa_set_level(Fl_Window *win, int level)
+{
+ NSWindow *nsw;
+ nsw = (NSWindow*)fl_xid(win);
+ [nsw setLevel:level];
+}
+
int cocoa_capture_displays(Fl_Window *win)
{
NSWindow *nsw;