diff options
author | runge <runge@karlrunge.com> | 2009-12-02 22:09:51 -0500 |
---|---|---|
committer | runge <runge@karlrunge.com> | 2009-12-02 22:09:51 -0500 |
commit | 00a9a0ea4d0f642b34b4423ea867099b52edf078 (patch) | |
tree | c9df2a624681358103c80e79847fd415cf3a8e2f /x11vnc/cursor.c | |
parent | f40b0111827677625d81b7b7fcd001ce285adf69 (diff) | |
download | libtdevnc-00a9a0ea4d0f642b34b4423ea867099b52edf078.tar.gz libtdevnc-00a9a0ea4d0f642b34b4423ea867099b52edf078.zip |
x11vnc: -appshare mode for sharing an application windows instead of the
entire desktop. map port + 5500 in reverse connect. Add id_cmd remote
control functions for id (and other) windows. Allow zero port in SSL
reverse connections. Adjust delays between multiple reverse connections;
X11VNC_REVERSE_SLEEP_MAX env var. Add some missing mutex locks; add
INPUT_LOCK and threads_drop_input. More safety in -threads mode for
new framebuffer change. Fix some stderr leaking in -inetd mode.
Diffstat (limited to 'x11vnc/cursor.c')
-rw-r--r-- | x11vnc/cursor.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/x11vnc/cursor.c b/x11vnc/cursor.c index 7ac0302..2ec93c3 100644 --- a/x11vnc/cursor.c +++ b/x11vnc/cursor.c @@ -576,7 +576,9 @@ void first_cursor(void) { return; } if (! show_cursor) { + LOCK(screen->cursorMutex); screen->cursor = NULL; + UNLOCK(screen->cursorMutex); } else { got_xfixes_cursor_notify++; set_rfb_cursor(get_which_cursor()); @@ -591,7 +593,7 @@ static void setup_cursors(void) { int w_in = 0, h_in = 0; static int first = 1; - if (verbose) { + if (verbose || use_threads) { rfbLog("setting up %d cursors...\n", CURS_MAX); } @@ -603,8 +605,8 @@ static void setup_cursors(void) { first = 0; if (screen) { - screen->cursor = NULL; LOCK(screen->cursorMutex); + screen->cursor = NULL; } for (i=0; i<CURS_MAX; i++) { @@ -985,7 +987,6 @@ static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo) { void initialize_xfixes(void) { #if LIBVNCSERVER_HAVE_LIBXFIXES if (xfixes_present) { - xfixes_first_initialized = 1; X_LOCK; if (use_xfixes) { XFixesSelectCursorInput(dpy, rootwin, @@ -994,6 +995,7 @@ void initialize_xfixes(void) { XFixesSelectCursorInput(dpy, rootwin, 0); } X_UNLOCK; + xfixes_first_initialized = 1; } #endif } @@ -1325,24 +1327,23 @@ static int get_exact_cursor(int init) { return which; } + X_LOCK; if (! got_xfixes_cursor_notify && xfixes_base_event_type) { /* try again for XFixesCursorNotify event */ XEvent xev; - X_LOCK; if (XCheckTypedEvent(dpy, xfixes_base_event_type + XFixesCursorNotify, &xev)) { got_xfixes_cursor_notify++; } - X_UNLOCK; } if (! got_xfixes_cursor_notify) { /* evidently no cursor change, just return last one */ + X_UNLOCK; return which; } got_xfixes_cursor_notify = 0; /* retrieve the cursor info + pixels from server: */ - X_LOCK; xfc = XFixesGetCursorImage(dpy); X_UNLOCK; if (! xfc) { @@ -1512,7 +1513,9 @@ void initialize_cursors_mode(void) { } } else { if (screen) { + LOCK(screen->cursorMutex); screen->cursor = NULL; + UNLOCK(screen->cursorMutex); set_cursor_was_changed(screen); } } @@ -1656,9 +1659,11 @@ static void set_cursor_was_changed(rfbScreenInfoPtr s) { return; } iter = rfbGetClientIterator(s); + LOCK(screen->cursorMutex); while( (cl = rfbClientIteratorNext(iter)) ) { cl->cursorWasChanged = TRUE; } + UNLOCK(screen->cursorMutex); rfbReleaseClientIterator(iter); } |