Revision: 4946 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4946&view=rev Author: ossman_ Date: 2012-07-20 12:39:27 +0000 (Fri, 20 Jul 2012) Log Message: ----------- Screen layout is relative our viewport, not the local machine's 0,0.
Modified Paths: -------------- trunk/vncviewer/DesktopWindow.cxx Modified: trunk/vncviewer/DesktopWindow.cxx =================================================================== --- trunk/vncviewer/DesktopWindow.cxx 2012-07-20 12:32:52 UTC (rev 4945) +++ trunk/vncviewer/DesktopWindow.cxx 2012-07-20 12:39:27 UTC (rev 4946) @@ -453,10 +453,11 @@ } #ifdef HAVE_FLTK_FULLSCREEN - if (!fullscreen_active()) { + if (!fullscreen_active() || (width > w()) || (height > h())) { #endif - // In windowed mode we just report a single virtual screen that - // covers the entire framebuffer. + // In windowed mode (or the framebuffer is so large that we need + // to scroll) we just report a single virtual screen that covers + // the entire framebuffer. layout = cc->cp.screenLayout; @@ -489,11 +490,12 @@ int i; rdr::U32 id; int sx, sy, sw, sh; - Rect fb_rect, screen_rect; + Rect viewport_rect, screen_rect; // In full screen we report all screens that are fully covered. - fb_rect.setXYWH(x + , 0, width, height); + viewport_rect.setXYWH(x() + (w() - width)/2, y() + (h() - height)/2, + width, height); // If we can find a matching screen in the existing set, we use // that, otherwise we create a brand new screen. @@ -506,9 +508,13 @@ // Check that the screen is fully inside the framebuffer screen_rect.setXYWH(sx, sy, sw, sh); - if (!screen_rect.enclosed_by(fb_rect)) + if (!screen_rect.enclosed_by(viewport_rect)) continue; + // Adjust the coordinates so they are relative to our viewport + sx -= viewport_rect.tl.x; + sy -= viewport_rect.tl.y; + // Look for perfectly matching existing screen... for (iter = cc->cp.screenLayout.begin(); iter != cc->cp.screenLayout.end(); ++iter) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits