From 115e935f72b58e72598c7fccf17364d6cd2fa5a1 Mon Sep 17 00:00:00 2001 From: runge Date: Tue, 11 Sep 2007 20:15:38 +0000 Subject: 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. --- x11vnc/cursor.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'x11vnc/cursor.c') 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); -- cgit v1.2.1