From cb819cb7c3fe4257d8718719fe18280a5c821e77 Mon Sep 17 00:00:00 2001 From: Boyan Ding Date: Sat, 28 Jun 2014 16:33:58 +0800 Subject: [PATCH] xwayland: Initialize device when reprobing Actions like VT switches can somehow make weston reprobe input devices, and cause xwayland create new devices, which, unlike the initial ones, goes uninitialized. This will make xwayland crash when it uses the new devices. This patch activates and enables the devices that are not CVP or CVK after they are created thus eliminates the problem. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=79609 Signed-off-by: Boyan Ding --- hw/xwayland/xwayland-input.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 990cb82..710109e 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -498,6 +498,10 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, xwl_seat_set_cursor(xwl_seat); xwl_seat->pointer = add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); + if (xwl_seat->pointer != inputInfo.pointer) { + ActivateDevice(xwl_seat->pointer, TRUE); + EnableDevice(xwl_seat->pointer, TRUE); + } } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->pointer) { wl_pointer_release(xwl_seat->wl_pointer); @@ -511,6 +515,10 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, &keyboard_listener, xwl_seat); xwl_seat->keyboard = add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); + if (xwl_seat->keyboard != inputInfo.keyboard) { + ActivateDevice(xwl_seat->keyboard, TRUE); + EnableDevice(xwl_seat->keyboard, TRUE); + } } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->keyboard) { wl_keyboard_release(xwl_seat->wl_keyboard); -- 2.0.1