[PATCH xserver] xwayland: do not set checkRepeat on master kbd

Peter Hutterer peter.hutterer at who-t.net
Wed Mar 1 23:36:01 UTC 2017


On Wed, Mar 01, 2017 at 08:51:31AM +0100, Olivier Fourdan wrote:
> If a key event is sent programmatically, the virtual core keyboard does
> not have its dev->public.devicePrivate set and we can't get the Xwayland
> seat, in which case we end up crashing in keyboard_check_repeat().
> 
> This is the case with "antimicro" which sends key events based on the
> joystick buttons.
> 
> Adding the checkRepeat handler on the VCK is useless anyway, so remove
> it and avoid the crash in keyboard_check_repeat() when trying to get the
> Xwayland seat.
> 
> Bugzilla: https://bugzilla.redhat.com/1416244
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> ---

Pushed, thanks. Note that I heavily reworded the commit message to
(hopefully) make it easier to reconstruct the bug once we've paged it all
out in a few days time :)

To git+ssh://git.freedesktop.org/git/xorg/xserver
   2781995..fe5c340  master -> master

Cheers,
   Peter


>  v2: Avoid the crash by not setting the checkRepeat handler on the master
>      keyboard - For some reason, I was convinced it was needed when I sent
>      the patch for commit 239705a (xwayland: add a server sync before
>      repeating keys) but on further consideration, I don't see how it 
>      could be, considering we cannot get to the xwl seat anyway.
>      Checked that removing it does not affect the key repeat mechanism
>      when the compositor is busy, it works equally well without this so
>      all is fine... My bad, thanks Peter!
> 
>  hw/xwayland/xwayland-input.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
> index 2ca99d9..1f5d323 100644
> --- a/hw/xwayland/xwayland-input.c
> +++ b/hw/xwayland/xwayland-input.c
> @@ -1027,8 +1027,6 @@ release_relative_pointer(struct xwl_seat *xwl_seat)
>  static void
>  init_keyboard(struct xwl_seat *xwl_seat)
>  {
> -    DeviceIntPtr master;
> -
>      xwl_seat->wl_keyboard = wl_seat_get_keyboard(xwl_seat->seat);
>      wl_keyboard_add_listener(xwl_seat->wl_keyboard,
>                               &keyboard_listener, xwl_seat);
> @@ -1040,9 +1038,6 @@ init_keyboard(struct xwl_seat *xwl_seat)
>      }
>      EnableDevice(xwl_seat->keyboard, TRUE);
>      xwl_seat->keyboard->key->xkbInfo->checkRepeat = keyboard_check_repeat;
> -    master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD);
> -    if (master)
> -        master->key->xkbInfo->checkRepeat = keyboard_check_repeat;
>  }
>  
>  static void
> -- 
> 2.9.3
> 


More information about the xorg-devel mailing list