diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2008-09-02 10:33:23 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2008-09-02 10:33:23 +0000 |
commit | 6b5b878913fd50e85aac2b64585e9c9206b63117 (patch) | |
tree | 5616260054835509e495ec4272fba3ecb6a6fbea /unix/x0vncserver/Geometry.cxx | |
parent | 2ef6695fe7dbc850d1981cbab04b7595f39328bc (diff) | |
download | tigervnc-6b5b878913fd50e85aac2b64585e9c9206b63117.tar.gz tigervnc-6b5b878913fd50e85aac2b64585e9c9206b63117.zip |
[Bugfix] Geometry::getVideoRect() should return coordinates relative to the
framebuffer shown to RFB clients. Previously, it returned absolute screen
coordinates so that the origin of video area could be displaced.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2745 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/Geometry.cxx')
-rw-r--r-- | unix/x0vncserver/Geometry.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/unix/x0vncserver/Geometry.cxx b/unix/x0vncserver/Geometry.cxx index 728c1136..94e2df68 100644 --- a/unix/x0vncserver/Geometry.cxx +++ b/unix/x0vncserver/Geometry.cxx @@ -60,16 +60,20 @@ Geometry::Geometry(int fullWidth, int fullHeight) width(), height(), offsetLeft(), offsetTop()); // Handle the VideoArea parameter, save the result in m_videoRect. + // Note that we log absolute coordinates but save relative ones. param = m_videoAreaParam.getData(); bool videoAreaSpecified = (strlen(param) > 0); if (videoAreaSpecified) { - m_videoRect = parseString(param); - if (isVideoAreaSet()) { + Rect absVideoRect = parseString(param); + if (!absVideoRect.is_empty()) { vlog.info("Video area set to %dx%d+%d+%d", - m_videoRect.width(), m_videoRect.height(), - m_videoRect.tl.x, m_videoRect.tl.y); + absVideoRect.width(), absVideoRect.height(), + absVideoRect.tl.x, absVideoRect.tl.y); + Point base(-offsetLeft(), -offsetTop()); + m_videoRect = absVideoRect.translate(base); } else { vlog.info("Video area was not set"); + m_videoRect.clear(); } } delete[] param; |