diff options
author | Boyan Ding <stu_dby@126.com> | 2014-08-04 21:16:34 +0800 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2015-09-21 08:48:47 +0200 |
commit | 1ba4fde1015fc6da19dfbfdf0f77f1071416e215 (patch) | |
tree | fc57b0f8b8c9f9deb1bd7388e10dce7e035196e7 /hw/xwayland | |
parent | f1995de1c43733a9e586605674c4071357a58e78 (diff) |
xwayland: Activate and enable device on first capability reporting
Commit 2172714c changed behavior of capability handling, but it only
solved part of the problem. If Xwayland is launched without a capability
(e.g. no pointer device is connected when Xwayland was spinned up), and
later that capability comes, the device added will not be automatically
initialized. This patch initializes the device when the capability is
reported for the first time, thus avoiding the problem.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=81819
Signed-off-by: Boyan Ding <stu_dby@126.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'hw/xwayland')
-rw-r--r-- | hw/xwayland/xwayland-input.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index a29ba782f..010d28c43 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -692,13 +692,13 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, wl_pointer_add_listener(xwl_seat->wl_pointer, &pointer_listener, xwl_seat); - if (xwl_seat->pointer) - EnableDevice(xwl_seat->pointer, TRUE); - else { + if (xwl_seat->pointer == NULL) { xwl_seat_set_cursor(xwl_seat); xwl_seat->pointer = add_device(xwl_seat, "xwayland-pointer", xwl_pointer_proc); + ActivateDevice(xwl_seat->pointer, TRUE); } + EnableDevice(xwl_seat->pointer, TRUE); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && xwl_seat->wl_pointer) { wl_pointer_release(xwl_seat->wl_pointer); xwl_seat->wl_pointer = NULL; @@ -712,12 +712,12 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, wl_keyboard_add_listener(xwl_seat->wl_keyboard, &keyboard_listener, xwl_seat); - if (xwl_seat->keyboard) - EnableDevice(xwl_seat->keyboard, TRUE); - else { + if (xwl_seat->keyboard == NULL) { xwl_seat->keyboard = add_device(xwl_seat, "xwayland-keyboard", xwl_keyboard_proc); + ActivateDevice(xwl_seat->keyboard, TRUE); } + EnableDevice(xwl_seat->keyboard, TRUE); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && xwl_seat->wl_keyboard) { wl_keyboard_release(xwl_seat->wl_keyboard); xwl_seat->wl_keyboard = NULL; |