aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-07-20 12:32:52 +0000
committerPierre Ossman <ossman@cendio.se>2012-07-20 12:32:52 +0000
commit93d2d9272b235a9bf51440e2471a8959b6adba27 (patch)
tree65e46e9236f1839a54e3d427a3eca906a67d2753 /vncviewer
parent510e89621fa0866198bc84d1ae3a4dc1bdf43e7f (diff)
downloadtigervnc-93d2d9272b235a9bf51440e2471a8959b6adba27.tar.gz
tigervnc-93d2d9272b235a9bf51440e2471a8959b6adba27.zip
Make sure we filter out any screens that aren't fully inside the new
framebuffer. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4945 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/DesktopWindow.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 391c023e..32e202a8 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -489,9 +489,12 @@ void DesktopWindow::remoteResize()
int i;
rdr::U32 id;
int sx, sy, sw, sh;
+ Rect fb_rect, screen_rect;
// In full screen we report all screens that are fully covered.
+ fb_rect.setXYWH(x + , 0, width, height);
+
// If we can find a matching screen in the existing set, we use
// that, otherwise we create a brand new screen.
//
@@ -501,6 +504,11 @@ void DesktopWindow::remoteResize()
for (i = 0;i < Fl::screen_count();i++) {
Fl::screen_xywh(sx, sy, sw, sh, i);
+ // Check that the screen is fully inside the framebuffer
+ screen_rect.setXYWH(sx, sy, sw, sh);
+ if (!screen_rect.enclosed_by(fb_rect))
+ continue;
+
// Look for perfectly matching existing screen...
for (iter = cc->cp.screenLayout.begin();
iter != cc->cp.screenLayout.end(); ++iter) {