[PATCH] xwayland: Activate and enable device on first capability reporting
Boyan Ding
stu_dby at 126.com
Mon Aug 4 06:16:34 PDT 2014
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 at 126.com>
---
hw/xwayland/xwayland-input.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index cc5f7df..12c1bbc 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -496,13 +496,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;
@@ -516,12 +516,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;
--
2.0.2
More information about the xorg-devel
mailing list