From 93d2d9272b235a9bf51440e2471a8959b6adba27 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 20 Jul 2012 12:32:52 +0000 Subject: [PATCH] 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 --- vncviewer/DesktopWindow.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) 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) { -- 2.39.5