diff options
author | Peter Åstrand <astrand@cendio.se> | 2009-12-09 12:31:35 +0000 |
---|---|---|
committer | Peter Åstrand <astrand@cendio.se> | 2009-12-09 12:31:35 +0000 |
commit | bec66d47dc9324483dbb98e2dfb887678de09ed7 (patch) | |
tree | fef3f0f709e66b5bb6f642518d734aba77a9c388 /unix | |
parent | b94d538633b6cf9a775f24c26b110e685768acda (diff) | |
download | tigervnc-bec66d47dc9324483dbb98e2dfb887678de09ed7.tar.gz tigervnc-bec66d47dc9324483dbb98e2dfb887678de09ed7.zip |
Avoid modifiers such as shift sticking.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_0@3925 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 9a5fb408..4e3fa9df 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -1104,6 +1104,14 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down) unsigned int i, n; int j, k; + /* + * 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; @@ -1220,6 +1228,15 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down) #endif ); } + + /* + * 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) |