On Thu, Nov 05, 2009 at 04:20:17PM +0100, Peter Åstrand wrote: > > >Hi. I'm debugging a keyboard problem where modifiers, such as > >shift, sometimes are stuck. Unfortunately, the problem happens > >very seldom, which >
Nice catch, I've never reproduced original issue but it seems your patch solves it. Please apply it to both trunk and 1_0. Btw I think the second mieqProcessInputEvents() call in the end of keyEvent function is not needed, is it? Regards, Adam > Suggested patch: > > Index: unix/xserver/hw/vnc/Input.cc > =================================================================== > --- unix/xserver/hw/vnc/Input.cc (revision 3917) > +++ unix/xserver/hw/vnc/Input.cc (arbetskopia) > @@ -373,6 +373,14 @@ > 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 @@ > 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) -- Adam Tkac, Red Hat, Inc. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Tigervnc-devel mailing list Tigervnc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-devel