]> source.dussan.org Git - tigervnc.git/commitdiff
Adjust cursor position according to geometry
authorPierre Ossman <ossman@cendio.se>
Mon, 10 Sep 2018 15:03:17 +0000 (17:03 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 10 Sep 2018 15:03:17 +0000 (17:03 +0200)
x0vncserver might only be observing part of the display, so we need
to adjust any coordinates before we give them to the RFB core.

unix/x0vncserver/XDesktop.cxx

index 110b79eb7c2dac81d91a6323f8cb1509fcf48ac0..d8360abd24a244a0ccde2bd5bd67ddb2879801f2 100644 (file)
@@ -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));
   }
 }