diff options
author | Pierre Ossman <ossman@cendio.se> | 2012-10-03 12:21:54 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2012-10-03 12:21:54 +0000 |
commit | 9e0e7543072fc579f7a1a0cd075487e88712a500 (patch) | |
tree | 95452e13ac230e153b4057add8e02739402231cd /vncviewer/DesktopWindow.cxx | |
parent | 002cc5d12989da562baa14e075f1386574a8d341 (diff) | |
download | tigervnc-9e0e7543072fc579f7a1a0cd075487e88712a500.tar.gz tigervnc-9e0e7543072fc579f7a1a0cd075487e88712a500.zip |
XFCE's window manager did not interact well with the code that avoided
accidental legacy full screen requests. Seems we need to sort that
FIXME out sooner rather than later.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5002 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index ed62de0f..fad5ad3e 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -281,26 +281,35 @@ void DesktopWindow::resize(int x, int y, int w, int h) #if ! (defined(WIN32) || defined(__APPLE__)) // X11 window managers will treat a resize to cover the entire // monitor as a request to go full screen. Make sure we avoid this. - // - // FIXME: If this is an external event then this code will get - // FLTK into a confused state about the window's position/size. - // Unfortunately FLTK doesn't offer an easy way to tell - // what kind of resize it is. Let's hope this corner case - // isn't too common... #ifdef HAVE_FLTK_FULLSCREEN if (!fullscreen_active()) #endif { - for (int i = 0;i < Fl::screen_count();i++) { - int sx, sy, sw, sh; - - Fl::screen_xywh(sx, sy, sw, sh, i); - - if ((sx == x) && (sy == y) && (sw == w) && (sh == h)) { - vlog.info("Adjusting window size to avoid accidental full screen request"); - // Assume a panel of some form and adjust the height - y += 20; - h -= 40; + // Get the real window coordinates, so we can determine if + // this is a request to resize, or a notification of a resize + // from the X server. + XWindowAttributes actual; + Window cr; + int wx, wy; + + XGetWindowAttributes(fl_display, fl_xid(this), &actual); + XTranslateCoordinates(fl_display, fl_xid(this), actual.root, + 0, 0, &wx, &wy, &cr); + + // Actual resize request? + if ((wx != x) || (wy != y) || + (actual.width != w) || (actual.height != h)) { + for (int i = 0;i < Fl::screen_count();i++) { + int sx, sy, sw, sh; + + Fl::screen_xywh(sx, sy, sw, sh, i); + + if ((sx == x) && (sy == y) && (sw == w) && (sh == h)) { + vlog.info("Adjusting window size to avoid accidental full screen request"); + // Assume a panel of some form and adjust the height + y += 20; + h -= 40; + } } } } |