summaryrefslogtreecommitdiffstats
path: root/vncviewer/DesktopWindow.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-07-20 12:39:27 +0000
committerPierre Ossman <ossman@cendio.se>2012-07-20 12:39:27 +0000
commitf44f6c02db249af0c579dcf5e59cbed2f549e2b7 (patch)
treef87c3fd6dcea51c49d2d0e9b6136cce9f6815ba6 /vncviewer/DesktopWindow.cxx
parent93d2d9272b235a9bf51440e2471a8959b6adba27 (diff)
downloadtigervnc-f44f6c02db249af0c579dcf5e59cbed2f549e2b7.tar.gz
tigervnc-f44f6c02db249af0c579dcf5e59cbed2f549e2b7.zip
Screen layout is relative our viewport, not the local machine's 0,0.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4946 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r--vncviewer/DesktopWindow.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 32e202a8..829d3dbe 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -453,10 +453,11 @@ void DesktopWindow::remoteResize()
}
#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 @@ void DesktopWindow::remoteResize()
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 @@ void DesktopWindow::remoteResize()
// 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) {