summaryrefslogtreecommitdiffstats
path: root/x11vnc/cursor.c
diff options
context:
space:
mode:
authorrunge <runge>2007-09-11 20:15:38 +0000
committerrunge <runge>2007-09-11 20:15:38 +0000
commit115e935f72b58e72598c7fccf17364d6cd2fa5a1 (patch)
tree1ce24590ac497725cb977dfc08ee363773928e89 /x11vnc/cursor.c
parent6a6d26a74701179672d59bfd153cc1a2e92e96bd (diff)
downloadlibtdevnc-115e935f72b58e72598c7fccf17364d6cd2fa5a1.tar.gz
libtdevnc-115e935f72b58e72598c7fccf17364d6cd2fa5a1.zip
x11vnc: fix wireframe crash under -clip. Add -redirect for
VNC redir. -rawfb nullbig, randbig, solid, swirl, etc. FD_XDM mode to find_display. -listdpy. Add enlightenment. Xvnc.redirect FINDDISPLAY-vnc_redirect. -xvnc, -xvnc_redirect, -svc_xvnc. AUTO_PORT.
Diffstat (limited to 'x11vnc/cursor.c')
-rw-r--r--x11vnc/cursor.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/x11vnc/cursor.c b/x11vnc/cursor.c
index ed83497..d7f500c 100644
--- a/x11vnc/cursor.c
+++ b/x11vnc/cursor.c
@@ -1790,6 +1790,13 @@ void cursor_position(int x, int y) {
y = nfix(y, scaled_y);
}
+ if (clipshift) {
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+ if (x >= dpy_x) x = dpy_x-1;
+ if (y >= dpy_y) y = dpy_y-1;
+ }
+
if (x == screen->cursorX && y == screen->cursorY) {
return;
}
@@ -1940,6 +1947,18 @@ if (0) fprintf(stderr, "check_x11_pointer %d %d\n", root_x, root_y);
x = root_x - off_x - coff_x;
y = root_y - off_y - coff_y;
+ if (clipshift) {
+ static int cnt = 0;
+ if (x < 0 || y < 0 || x >= dpy_x || y >= dpy_y) {
+ if (cnt++ % 4 != 0) {
+ if (debug_pointer) {
+ rfbLog("Skipping cursor_position() outside our clipshift\n");
+ }
+ return 0;
+ }
+ }
+ }
+
/* record the cursor position in the rfb screen */
cursor_position(x, y);