summaryrefslogtreecommitdiffstats
path: root/x11vnc/cursor.c
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2009-05-21 10:57:03 -0400
committerrunge <runge@karlrunge.com>2009-05-21 10:57:03 -0400
commit94d058b35f075cec2d6e8b6e37ee1a94086ea3f8 (patch)
tree6cec0620ab70b5db6b33645dbcac1071f3c7a556 /x11vnc/cursor.c
parent804335f9d296440bb708ca844f5d89b58b50b0c6 (diff)
downloadlibtdevnc-94d058b35f075cec2d6e8b6e37ee1a94086ea3f8.tar.gz
libtdevnc-94d058b35f075cec2d6e8b6e37ee1a94086ea3f8.zip
Thread safety. Fix -clip -in -rawfb. Try to avoid Xorg stuck
key bug.
Diffstat (limited to 'x11vnc/cursor.c')
-rw-r--r--x11vnc/cursor.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/x11vnc/cursor.c b/x11vnc/cursor.c
index 69696fd..2409872 100644
--- a/x11vnc/cursor.c
+++ b/x11vnc/cursor.c
@@ -897,8 +897,6 @@ static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo) {
RAWFB_RET_VOID
- X_LOCK;
-
if (!strcmp(s, "default") || !strcmp(s, "X") || !strcmp(s, "arrow")) {
nm_info = 0;
}
@@ -978,8 +976,6 @@ static void tree_descend_cursor(int *depth, Window *w, win_str_info_t *winfo) {
XSetErrorHandler(old_handler);
trapped_xerror = 0;
- X_UNLOCK;
-
*depth = descend;
*w = wins[descend];
#endif /* NO_X11 */
@@ -1522,7 +1518,7 @@ int get_which_cursor(void) {
int db = 0;
if (show_multiple_cursors) {
- int depth = 0;
+ int depth = 0, rint;
static win_str_info_t winfo;
static int first = 1, depth_cutoff = -1;
Window win = None;
@@ -1550,12 +1546,14 @@ int get_which_cursor(void) {
}
if (rawfb_vnc_reflect && mode > -1) {
- return get_exact_cursor(0);
+ rint = get_exact_cursor(0);
+ return rint;
}
if (mode == 3) {
if ((xfixes_present && use_xfixes) || macosx_console) {
if (db) fprintf(stderr, "get_which_cursor call get_exact_cursor\n");
- return get_exact_cursor(0);
+ rint = get_exact_cursor(0);
+ return rint;
}
}
@@ -1575,7 +1573,9 @@ int get_which_cursor(void) {
}
first = 0;
+ X_LOCK;
tree_descend_cursor(&depth, &win, &winfo);
+ X_UNLOCK;
if (depth <= depth_cutoff && !subwin) {
which = CURS_ROOT;
@@ -1939,7 +1939,7 @@ int check_x11_pointer(void) {
Window root_w, child_w;
rfbBool ret = 0;
int root_x, root_y, win_x, win_y;
- int x, y;
+ int x, y, rint;
unsigned int mask;
if (unixpw_in_progress) return 0;
@@ -2006,6 +2006,7 @@ if (0) fprintf(stderr, "check_x11_pointer %d %d\n", root_x, root_y);
cursor_position(x, y);
/* change the cursor shape if necessary */
- return set_cursor(x, y, get_which_cursor());
+ rint = set_cursor(x, y, get_which_cursor());
+ return rint;
}