aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-09-10 17:03:17 +0200
committerPierre Ossman <ossman@cendio.se>2018-09-10 17:03:17 +0200
commitc86ce3eeef5521134e8d30e6009dafc6b7c1759f (patch)
tree5032f7a3712cb62631880967bdc261c8405060d2
parentd95be6c752d3658b7b5f41eb6971f49db59b3088 (diff)
downloadtigervnc-c86ce3eeef5521134e8d30e6009dafc6b7c1759f.tar.gz
tigervnc-c86ce3eeef5521134e8d30e6009dafc6b7c1759f.zip
Adjust cursor position according to geometry
x0vncserver might only be observing part of the display, so we need to adjust any coordinates before we give them to the RFB core.
-rw-r--r--unix/x0vncserver/XDesktop.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
index 110b79eb..d8360abd 100644
--- a/unix/x0vncserver/XDesktop.cxx
+++ b/unix/x0vncserver/XDesktop.cxx
@@ -204,6 +204,8 @@ void XDesktop::poll() {
unsigned int mask;
XQueryPointer(dpy, DefaultRootWindow(dpy), &root, &child,
&x, &y, &wx, &wy, &mask);
+ x -= geometry->offsetLeft();
+ y -= geometry->offsetTop();
server->setCursorPos(rfb::Point(x, y));
}
}