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

Olivier Fourdan ofourdan at redhat.com
Wed Mar 1 07:51:31 UTC 2017

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>
 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);
                              &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

More information about the xorg-devel mailing list