[PATCH weston v3] input: don't send to clients key events eaten by bindings

Bill Spitzak spitzak at gmail.com
Wed Nov 12 12:06:16 PST 2014

On 11/12/2014 03:15 AM, Pekka Paalanen wrote:

>>> - In the Wayland terminal, press Ctrl, then D. The wayland terminal exits
>>> due to the shell getting EOF and quitting. The xterm gets focus.
>>> - Release Ctrl but continue holding down 'd'. The 'd' starts to repeat in
>>> the xterm.
> I don't get this behaviour. The xterm gets Ctrl+d, interprets it as
> EOF, and causes it eventually exit.

That does not happen to me. My xterm seems to ignore the fact that 'd' 
is held down until Ctrl is released, at which point it starts producing 
the 'd'.

However it does not matter.

The important point is that in both your and my case the client that has 
just received focus sees the 'd' as being held down. The 'd' is on in 
the key-down array attached to the focus-in event!!!!

Apparently if Ctrl+D was a "compositor shortcut" to close a window, then 
this patch will cause the 'd' to not be there. But since Ctrl+D is 
handled by a client to close the window, the client with the new focus 
*does* see it. WHY IS THIS DIFFERENT??????

IMHO they should not be different, therefore this patch is wrong. There 
are two possible solutions:

1. Revert it. The actual bug is that a client that already has focus 
before a "compositor shortcut" will not get any changes to the keymap. 
Add something to fix this instead. I recommend a redundant focus-in event.

2. Always send a blank key-down array in the focus-in event, since it is 
possible that any key held down was the "shortcut" that caused the 
focus-in event.

More information about the wayland-devel mailing list