[PATCH] xwayland: Initialize device when reprobing

Boyan Ding stu_dby at 126.com
Sun Jun 29 18:25:25 PDT 2014


Sorry, this patch is sent not the right one, please refer to
http://lists.x.org/archives/xorg-devel/2014-June/042924.html instead.

Thanks,
Boyan Ding

On Sat, 2014-06-28 at 16:45 +0800, Boyan Ding wrote:
> 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 <stu_dby at 126.com>
> ---
>  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);





More information about the xorg-devel mailing list