summaryrefslogtreecommitdiffstats
path: root/x11vnc/keyboard.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/keyboard.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/keyboard.c')
-rw-r--r--x11vnc/keyboard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/x11vnc/keyboard.c b/x11vnc/keyboard.c
index 040b2d0..c6dec3c 100644
--- a/x11vnc/keyboard.c
+++ b/x11vnc/keyboard.c
@@ -397,13 +397,12 @@ void autorepeat(int restore, int bequiet) {
return; /* nothing to restore */
}
global_auto_repeat = get_autorepeat_state();
- X_LOCK;
/* read state and skip restore if equal (e.g. no clients) */
if (global_auto_repeat == save_auto_repeat) {
- X_UNLOCK;
return;
}
+ X_LOCK;
kctrl.auto_repeat_mode = save_auto_repeat;
XChangeKeyboardControl(dpy, KBAutoRepeatMode, &kctrl);
XFlush_wr(dpy);
@@ -2641,6 +2640,7 @@ static void tweak_mod(signed char mod, rfbBool down) {
XTestFakeKeyEvent_wr(dpy, altgr, dn, CurrentTime);
}
X_UNLOCK;
+
if (debug_keyboard) {
rfbLog("tweak_mod: Finish: down=%d index=%d mod_state=0x%x"
" is_shift=%d\n", down, (int) mod, (int) mod_state,
@@ -2758,6 +2758,7 @@ void initialize_keyboard_and_pointer(void) {
initialize_remap(remap_file);
initialize_pointer_map(pointer_remap);
+ X_LOCK;
clear_modifiers(1);
if (clear_mods == 1) {
clear_modifiers(0);
@@ -2765,6 +2766,7 @@ void initialize_keyboard_and_pointer(void) {
if (clear_mods == 3) {
clear_locks();
}
+ X_UNLOCK;
}
void get_allowed_input(rfbClientPtr client, allowed_input_t *input) {