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

Pekka Paalanen ppaalanen at gmail.com
Wed Nov 12 03:18:21 PST 2014


On Tue, 11 Nov 2014 16:10:22 +0200
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:

> 2014-11-11 15:10 GMT+02:00 Pekka Paalanen <ppaalanen at gmail.com>:
> > On Tue, 11 Nov 2014 11:23:40 +0200
> > Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> >
> >> weston key bindings are supposed to eat the key events, and not pass it
> >> on to clients, and indeed the wl_keyboard.key event is not sent. But
> >> we must also not put the key in the keys array to pass to client with
> >> the wl_keyboard.enter event, or else we may send the 'eaten' one too.
> >> In the case of a key binding hiding a surface having the keyboard focus,
> >> the shell may decide to give the focus to another surface, but that will
> >> happen before the key is released, so the new focus surface will receive
> >> the code of the bound key in the wl_keyboard.enter array.
> >> ---
> >>
> >> v4: - initialize and release the eaten_keys array
> >>     - check the eaten_keys array is empty before updating the keymap
> >>       (i'm am not completely sure this is correct to be honest, but i think so :) )
> >>
> >>  src/bindings.c   |  7 ++++--
> >>  src/compositor.h |  3 ++-
> >>  src/input.c      | 67 ++++++++++++++++++++++++++++++++++++++++----------------
> >>  3 files changed, 55 insertions(+), 22 deletions(-)

...

> >
> > I do wonder about notify_keyboard_focus_in(), though. That one is also
> > running key bindings, so should it too be filtering eaten keys?
> >
> > Actually, should focus_in be running key bindings at all?
> 
> I've been wondering that too, I don't think it makes much sense. I can
> make a follow up patch if we have an agreement.

I seem to have an agreement:

< pq> I do wonder if notify_keyboard_focus_in() running the keybindings is a sane thing to do...
< daniels> pq: no, i don't think it is
< daniels> pq: update modifiers definitely, running bindings no

Go for it. :-)


Thanks,
pq


More information about the wayland-devel mailing list