summaryrefslogtreecommitdiffstats
path: root/x11vnc/keyboard.c
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2009-12-02 22:09:51 -0500
committerrunge <runge@karlrunge.com>2009-12-02 22:09:51 -0500
commit00a9a0ea4d0f642b34b4423ea867099b52edf078 (patch)
treec9df2a624681358103c80e79847fd415cf3a8e2f /x11vnc/keyboard.c
parentf40b0111827677625d81b7b7fcd001ce285adf69 (diff)
downloadlibtdevnc-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/keyboard.c')
-rw-r--r--x11vnc/keyboard.c15
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;
}