diff options
author | Peter Åstrand <astrand@cendio.se> | 2009-12-09 12:28:19 +0000 |
---|---|---|
committer | Peter Åstrand <astrand@cendio.se> | 2009-12-09 12:28:19 +0000 |
commit | 4b0d0367b0a87675103bf5b6ee98af4809ab07bf (patch) | |
tree | 1b8feb09e3a6b76824019f5bb9d2e522de66d6c1 /unix | |
parent | 6cbd9d18132a7b8d3973efda852f42fa49a2aef0 (diff) | |
download | tigervnc-4b0d0367b0a87675103bf5b6ee98af4809ab07bf.tar.gz tigervnc-4b0d0367b0a87675103bf5b6ee98af4809ab07bf.zip |
Avoid modifiers such as shift sticking.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3924 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r-- | unix/xserver/hw/vnc/Input.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc index 478240c4..4ad1564d 100644 --- a/unix/xserver/hw/vnc/Input.cc +++ b/unix/xserver/hw/vnc/Input.cc @@ -373,6 +373,14 @@ void KeyboardDevice::keyEvent(rdr::U32 keysym, bool down) unsigned int i, n; int j, k, action; + /* + * Since we are checking the current state to determine if we need + * to fake modifiers, we must make sure that everything put on the + * input queue is processed before we start. Otherwise, shift may be + * stuck down. + */ + mieqProcessInputEvents(); + if (keysym == XK_Caps_Lock) { vlog.debug("Ignoring caps lock"); return; @@ -506,6 +514,15 @@ ModeSwitchFound: action = down ? KeyPress : KeyRelease; n = GetKeyboardEvents(eventq, dev, action, kc); enqueueEvents(dev, n); + + /* + * When faking a modifier we are putting a keycode (which can + * currently activate the desired modifier) on the input + * queue. A future modmap change can change the mapping so + * that this keycode means something else entirely. Guard + * against this by processing the queue now. + */ + mieqProcessInputEvents(); } static KeySym KeyCodetoKeySym(KeySymsPtr keymap, int keycode, int col) |