diff options
Diffstat (limited to 'x11vnc/keyboard.c')
-rw-r--r-- | x11vnc/keyboard.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/x11vnc/keyboard.c b/x11vnc/keyboard.c index 9aee9ca..3713210 100644 --- a/x11vnc/keyboard.c +++ b/x11vnc/keyboard.c @@ -3056,6 +3056,10 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { static double max_keyrepeat_last_time = 0.0; static double max_keyrepeat_always = -1.0; + if (threads_drop_input) { + return; + } + dtime0(&tnow); got_keyboard_calls++; @@ -3125,6 +3129,8 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { } } + INPUT_LOCK; + last_down = down; last_keysym = keysym; last_keyboard_time = tnow; @@ -3215,6 +3221,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { if (db) rfbLog("--- scroll keyrate skipping 0x%lx %s " "%.4f %.4f\n", keysym, down ? "down":"up ", tnow - x11vnc_start, tnow - max_keyrepeat_last_time); + INPUT_UNLOCK; return; } } @@ -3237,6 +3244,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { tnow - x11vnc_start, tnow - max_keyrepeat_last_time); max_keyrepeat_last_keysym = keysym; skipped_last_down = 1; + INPUT_UNLOCK; return; } else { if (db) rfbLog("--- scroll keyrate KEEPING 0x%lx %s " @@ -3267,15 +3275,18 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { got_user_input++; got_keyboard_input++; } + INPUT_UNLOCK; return; } } if (view_only) { + INPUT_UNLOCK; return; } get_allowed_input(client, &input); if (! input.keystroke) { + INPUT_UNLOCK; return; } @@ -3327,6 +3338,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { char *b, bstr[32]; if (! down) { + INPUT_UNLOCK; return; /* nothing to send */ } if (debug_keyboard) { @@ -3360,6 +3372,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { } XFlush_wr(dpy); X_UNLOCK; + INPUT_UNLOCK; return; } @@ -3368,6 +3381,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { X_LOCK; XFlush_wr(dpy); X_UNLOCK; + INPUT_UNLOCK; return; } @@ -3394,6 +3408,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { } X_UNLOCK; + INPUT_UNLOCK; } |