xserver: Branch 'xwayland-1.12' - 2 commits

Kristian Høgsberg krh at kemper.freedesktop.org
Wed May 16 12:29:15 PDT 2012


 Xi/exevents.c                          |    2 
 hw/xfree86/xwayland/xwayland-cursor.c  |   16 -
 hw/xfree86/xwayland/xwayland-input.c   |  268 ++++++++++++++-------------------
 hw/xfree86/xwayland/xwayland-private.h |    8 
 hw/xfree86/xwayland/xwayland-window.c  |   14 -
 hw/xfree86/xwayland/xwayland.c         |   14 -
 6 files changed, 146 insertions(+), 176 deletions(-)

New commits:
commit c4b932af6253d0592c2735bdc1da13658cbf8bfc
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Wed May 16 15:29:20 2012 -0400

    Update to wl_seat protocol change

diff --git a/hw/xfree86/xwayland/xwayland-cursor.c b/hw/xfree86/xwayland/xwayland-cursor.c
index f53ef94..2bbebcb 100644
--- a/hw/xfree86/xwayland/xwayland-cursor.c
+++ b/hw/xfree86/xwayland/xwayland-cursor.c
@@ -152,7 +152,7 @@ xwl_set_cursor(DeviceIntPtr device,
 	       ScreenPtr screen, CursorPtr cursor, int x, int y)
 {
     struct xwl_screen *xwl_screen;
-    struct xwl_input_device *xwl_input_device;
+    struct xwl_seat *xwl_seat;
     struct wl_buffer *buffer;
 
     if (!cursor)
@@ -160,17 +160,17 @@ xwl_set_cursor(DeviceIntPtr device,
 
     xwl_screen = xwl_screen_get(screen);
 
-    if (!xwl_screen || xorg_list_is_empty(&xwl_screen->input_device_list))
-	return ;
+    if (!xwl_screen || xorg_list_is_empty(&xwl_screen->seat_list))
+	return;
 
-    xwl_input_device = xorg_list_first_entry(&xwl_screen->input_device_list,
-					     struct xwl_input_device, link);
+    xwl_seat = xorg_list_first_entry(&xwl_screen->seat_list,
+					     struct xwl_seat, link);
 
     buffer = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key);
 
-    wl_input_device_attach(xwl_input_device->input_device,
-			   xwl_input_device->pointer_enter_serial, buffer,
-			   cursor->bits->xhot, cursor->bits->yhot);
+    wl_pointer_attach(xwl_seat->wl_pointer,
+		      xwl_seat->pointer_enter_serial, buffer,
+		      cursor->bits->xhot, cursor->bits->yhot);
 }
 
 static void
diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
index e8779ff..706623a 100644
--- a/hw/xfree86/xwayland/xwayland-input.c
+++ b/hw/xfree86/xwayland/xwayland-input.c
@@ -234,7 +234,7 @@ xwl_input_setup(pointer module, pointer opts, int *errmaj, int *errmin)
 }
 
 static DeviceIntPtr
-device_added(struct xwl_input_device *xwl_input_device, const char *driver)
+device_added(struct xwl_seat *xwl_seat, const char *driver)
 {
     DeviceIntPtr dev = NULL;
     InputInfoPtr pInfo;
@@ -246,13 +246,12 @@ device_added(struct xwl_input_device *xwl_input_device, const char *driver)
 
     pInfo->driver = xstrdup(driver);
 
-    if (asprintf(&pInfo->name, "%s:%d",
-		 pInfo->driver, xwl_input_device->id) == -1) {
+    if (asprintf(&pInfo->name, "%s:%d", pInfo->driver, xwl_seat->id) == -1) {
 	free(pInfo);
 	return NULL;
     }
 
-    pInfo->private = xwl_input_device;
+    pInfo->private = xwl_seat;
 
     rc = xf86NewInputDevice(pInfo, &dev, 1);
     if (rc != Success) {
@@ -267,37 +266,63 @@ device_added(struct xwl_input_device *xwl_input_device, const char *driver)
 }
 
 static void
-input_device_handle_motion(void *data, struct wl_input_device *input_device,
-			   uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
+pointer_handle_enter(void *data, struct wl_pointer *pointer,
+		     uint32_t serial, struct wl_surface *surface,
+		     wl_fixed_t sx_w, wl_fixed_t sy_w)
+
+{
+    struct xwl_seat *xwl_seat = data;
+
+    xwl_seat->xwl_screen->serial = serial;
+    xwl_seat->pointer_enter_serial = serial;
+
+    xwl_seat->focus_window = wl_surface_get_user_data(surface);
+
+    SetDeviceRedirectWindow(xwl_seat->pointer, xwl_seat->focus_window->window);
+}
+
+static void
+pointer_handle_leave(void *data, struct wl_pointer *pointer,
+		     uint32_t serial, struct wl_surface *surface)
+{
+    struct xwl_seat *xwl_seat = data;
+
+    xwl_seat->xwl_screen->serial = serial;
+
+    xwl_seat->focus_window = NULL;
+    SetDeviceRedirectWindow(xwl_seat->pointer, PointerRootWin);
+}
+
+static void
+pointer_handle_motion(void *data, struct wl_pointer *pointer,
+		      uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
 {
-    struct xwl_input_device *xwl_input_device = data;
-    struct xwl_screen *xwl_screen = xwl_input_device->xwl_screen;
+    struct xwl_seat *xwl_seat = data;
+    struct xwl_screen *xwl_screen = xwl_seat->xwl_screen;
     int32_t dx, dy, lx, ly;
     int sx = wl_fixed_to_int(sx_w);
     int sy = wl_fixed_to_int(sy_w);
 
-    if (!xwl_input_device->focus_window)
+    if (!xwl_seat->focus_window)
 	return ;
 
-    dx = xwl_input_device->focus_window->window->drawable.x;
-    dy = xwl_input_device->focus_window->window->drawable.y;
+    dx = xwl_seat->focus_window->window->drawable.x;
+    dy = xwl_seat->focus_window->window->drawable.y;
 
     lx = xf86ScaleAxis(sx + dx, 0xFFFF, 0, xwl_screen->scrninfo->virtualX, 0);
     ly = xf86ScaleAxis(sy + dy, 0xFFFF, 0, xwl_screen->scrninfo->virtualY, 0);
 
-    xf86PostMotionEvent(xwl_input_device->pointer,
-			TRUE, 0, 2, lx, ly);
+    xf86PostMotionEvent(xwl_seat->pointer, TRUE, 0, 2, lx, ly);
 }
 
 static void
-input_device_handle_button(void *data, struct wl_input_device *input_device,
-			   uint32_t serial, uint32_t time, uint32_t button,
-			   uint32_t state)
+pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,
+		      uint32_t time, uint32_t button, uint32_t state)
 {
-    struct xwl_input_device *xwl_input_device = data;
+    struct xwl_seat *xwl_seat = data;
     int index;
 
-    xwl_input_device->xwl_screen->serial = serial;
+    xwl_seat->xwl_screen->serial = serial;
 
     switch (button) {
     case BTN_MIDDLE:
@@ -311,19 +336,41 @@ input_device_handle_button(void *data, struct wl_input_device *input_device,
 	break;
     }
 
-    xf86PostButtonEvent(xwl_input_device->pointer,
-			TRUE, index, state, 0, 0);
+    xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, state, 0, 0);
 }
 
 static void
-input_device_handle_key(void *data, struct wl_input_device *input_device,
-			uint32_t serial, uint32_t time, uint32_t key,
-			uint32_t state)
+pointer_handle_axis(void *data, struct wl_pointer *pointer,
+		    uint32_t time, uint32_t axis, int32_t value)
 {
-    struct xwl_input_device *xwl_input_device = data;
+    struct xwl_seat *xwl_seat = data;
+    int index;
+
+    if (value == 1)
+        index = 4;
+    else if (value == -1)
+        index = 5;
+
+    xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 1, 0, 0);
+    xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 0, 0, 0);
+}
+
+static const struct wl_pointer_listener pointer_listener = {
+	pointer_handle_enter,
+	pointer_handle_leave,
+	pointer_handle_motion,
+	pointer_handle_button,
+	pointer_handle_axis,
+};
+
+static void
+keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial,
+		    uint32_t time, uint32_t key, uint32_t state)
+{
+    struct xwl_seat *xwl_seat = data;
     uint32_t modifier;
 
-    xwl_input_device->xwl_screen->serial = serial;
+    xwl_seat->xwl_screen->serial = serial;
 
     switch (key) {
     case KEY_LEFTMETA:
@@ -336,174 +383,95 @@ input_device_handle_key(void *data, struct wl_input_device *input_device,
     }
 
     if (state)
-	xwl_input_device->modifiers |= modifier;
+	xwl_seat->modifiers |= modifier;
     else
-	xwl_input_device->modifiers &= ~modifier;
-
-    xf86PostKeyboardEvent(xwl_input_device->keyboard, key + 8, state);
-}
-
-static void
-input_device_handle_pointer_enter(void *data,
-				  struct wl_input_device *input_device,
-				  uint32_t serial, struct wl_surface *surface,
-				  wl_fixed_t sx_w, wl_fixed_t sy_w)
-
-{
-    struct xwl_input_device *xwl_input_device = data;
-
-    xwl_input_device->xwl_screen->serial = serial;
-    xwl_input_device->pointer_enter_serial = serial;
-
-    xwl_input_device->focus_window = wl_surface_get_user_data(surface);
+	xwl_seat->modifiers &= ~modifier;
 
-    SetDeviceRedirectWindow(xwl_input_device->pointer,
-                            xwl_input_device->focus_window->window);
+    xf86PostKeyboardEvent(xwl_seat->keyboard, key + 8, state);
 }
 
 static void
-input_device_handle_keyboard_enter(void *data,
-				   struct wl_input_device *input_device,
-				   uint32_t serial,
-				   struct wl_surface *surface,
-				   struct wl_array *keys)
+keyboard_handle_enter(void *data, struct wl_keyboard *keyboard,
+		      uint32_t serial,
+		      struct wl_surface *surface, struct wl_array *keys)
 {
-    struct xwl_input_device *xwl_input_device = data;
+    struct xwl_seat *xwl_seat = data;
     uint32_t *k, *end;
 
-    xwl_input_device->xwl_screen->serial = serial;
+    xwl_seat->xwl_screen->serial = serial;
 
-    xwl_input_device->modifiers = 0;
+    xwl_seat->modifiers = 0;
     end = (uint32_t *) ((char *) keys->data + keys->size);
     for (k = keys->data; k < end; k++) {
 	switch (*k) {
 	case KEY_LEFTMETA:
 	case KEY_RIGHTMETA:
-	    xwl_input_device->modifiers |= MODIFIER_META;
+	    xwl_seat->modifiers |= MODIFIER_META;
 	    break;
 	}
     }
 }
 
 static void
-input_device_handle_axis(void *data, struct wl_input_device *input_device,
-                         uint32_t time, uint32_t axis, int32_t value)
+keyboard_handle_leave(void *data, struct wl_keyboard *keyboard,
+		      uint32_t serial, struct wl_surface *surface)
 {
-    struct xwl_input_device *xwl_input_device = data;
-    int index;
-
-    if (value == 1)
-        index = 4;
-    else if (value == -1)
-        index = 5;
-
-    xf86PostButtonEvent(xwl_input_device->pointer, TRUE, index, 1, 0, 0);
-    xf86PostButtonEvent(xwl_input_device->pointer, TRUE, index, 0, 0, 0);
-}
-
-static void
-input_device_handle_pointer_leave(void *data,
-                                  struct wl_input_device *input_device,
-                                  uint32_t serial, struct wl_surface *surface)
-{
-    struct xwl_input_device *xwl_input_device = data;
-
-    xwl_input_device->xwl_screen->serial = serial;
-
-    xwl_input_device->focus_window = NULL;
-    SetDeviceRedirectWindow(xwl_input_device->pointer, PointerRootWin);
-}
-
-static void
-input_device_handle_keyboard_leave(void *data,
-                                   struct wl_input_device *input_device,
-                                   uint32_t serial,
-                                   struct wl_surface *surface)
-{
-    struct xwl_input_device *xwl_input_device = data;
+    struct xwl_seat *xwl_seat = data;
 
-    xwl_input_device->xwl_screen->serial = serial;
+    xwl_seat->xwl_screen->serial = serial;
 }
 
-static void
-input_device_handle_touch_down(void *data,
-                               struct wl_input_device *wl_input_device,
-                               uint32_t serial, uint32_t time,
-			       struct wl_surface *surface,
-                               int32_t id, wl_fixed_t x, wl_fixed_t y)
-{
-}
-
-static void
-input_device_handle_touch_up(void *data,
-                             struct wl_input_device *wl_input_device,
-                             uint32_t serial, uint32_t time, int32_t id)
-{
-}
+static const struct wl_keyboard_listener keyboard_listener = {
+	keyboard_handle_enter,
+	keyboard_handle_leave,
+	keyboard_handle_key,
+};
 
 static void
-input_device_handle_touch_motion(void *data,
-                                 struct wl_input_device *wl_input_device,
-                                 uint32_t time, int32_t id,
-                                 wl_fixed_t x, wl_fixed_t y)
+seat_handle_capabilities(void *data, struct wl_seat *seat,
+			 enum wl_seat_capability caps)
 {
-}
+	struct xwl_seat *xwl_seat = data;
 
-static void
-input_device_handle_touch_frame(void *data,
-				struct wl_input_device *wl_input_device)
-{
-}
+	if (caps & WL_SEAT_CAPABILITY_POINTER) {
+	    xwl_seat->pointer = device_added(xwl_seat, "xwayland-pointer");
+	    xwl_seat->wl_pointer = wl_seat_get_pointer(seat);
+	    wl_pointer_add_listener(xwl_seat->wl_pointer,
+				    &pointer_listener, xwl_seat);
+	}
 
-static void
-input_device_handle_touch_cancel(void *data,
-				 struct wl_input_device *wl_input_device)
-{
+	if (caps & WL_SEAT_CAPABILITY_KEYBOARD) {
+	    xwl_seat->keyboard = device_added(xwl_seat, "xwayland-keyboard");
+	    xwl_seat->wl_keyboard = wl_seat_get_keyboard(seat);
+	    wl_keyboard_add_listener(xwl_seat->wl_keyboard,
+				     &keyboard_listener, xwl_seat);
+	}
 }
 
-static const struct wl_input_device_listener input_device_listener = {
-    input_device_handle_motion,
-    input_device_handle_button,
-    input_device_handle_axis,
-    input_device_handle_key,
-    input_device_handle_pointer_enter,
-    input_device_handle_pointer_leave,
-    input_device_handle_keyboard_enter,
-    input_device_handle_keyboard_leave,
-    input_device_handle_touch_down,
-    input_device_handle_touch_up,
-    input_device_handle_touch_motion,
-    input_device_handle_touch_frame,
-    input_device_handle_touch_cancel,
+static const struct wl_seat_listener seat_listener = {
+	seat_handle_capabilities,
 };
 
 static void
 create_input_device(struct xwl_screen *xwl_screen, uint32_t id,
 		    uint32_t version)
 {
-    struct xwl_input_device *xwl_input_device;
+    struct xwl_seat *xwl_seat;
 
-    xwl_input_device = calloc(sizeof *xwl_input_device, 1);
-    if (xwl_input_device == NULL) {
+    xwl_seat = calloc(sizeof *xwl_seat, 1);
+    if (xwl_seat == NULL) {
 	ErrorF("create_input ENOMEM");
 	return ;
     }
 
-    xwl_input_device->xwl_screen = xwl_screen;
-    xorg_list_add(&xwl_input_device->link, &xwl_screen->input_device_list);
-
-    xwl_input_device->pointer =
-	device_added(xwl_input_device, "xwayland-pointer");
-    xwl_input_device->keyboard =
-	device_added(xwl_input_device, "xwayland-keyboard");
+    xwl_seat->xwl_screen = xwl_screen;
+    xorg_list_add(&xwl_seat->link, &xwl_screen->seat_list);
 
-    xwl_input_device->input_device =
-        wl_display_bind(xwl_screen->display, id, &wl_input_device_interface);
-    xwl_input_device->id = id;
+    xwl_seat->seat =
+	wl_display_bind(xwl_screen->display, id, &wl_seat_interface);
+    xwl_seat->id = id;
 
-    wl_input_device_add_listener(xwl_input_device->input_device,
-				 &input_device_listener,
-				 xwl_input_device);
+    wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
 }
 
 static void
@@ -515,7 +483,7 @@ input_handler(struct wl_display *display,
 {
     struct xwl_screen *xwl_screen = data;
 
-    if (strcmp (interface, "wl_input_device") == 0) {
+    if (strcmp (interface, "wl_seat") == 0) {
         create_input_device(xwl_screen, id, 1);
     }
 }
diff --git a/hw/xfree86/xwayland/xwayland-private.h b/hw/xfree86/xwayland/xwayland-private.h
index 4d6fbab..bde56f2 100644
--- a/hw/xfree86/xwayland/xwayland-private.h
+++ b/hw/xfree86/xwayland/xwayland-private.h
@@ -57,7 +57,7 @@ struct xwl_screen {
     uint32_t			 flags;
     char			*device_name;
     uint32_t			 authenticated;
-    struct xorg_list		 input_device_list;
+    struct xorg_list		 seat_list;
     struct xorg_list		 damage_window_list;
     struct xorg_list		 window_list;
     uint32_t			 serial;
@@ -87,11 +87,13 @@ struct xwl_output {
 
 #define MODIFIER_META 0x01
 
-struct xwl_input_device {
+struct xwl_seat {
     DeviceIntPtr		 pointer;
     DeviceIntPtr		 keyboard;
     struct xwl_screen		*xwl_screen;
-    struct wl_input_device	*input_device;
+    struct wl_seat		*seat;
+    struct wl_pointer		*wl_pointer;
+    struct wl_keyboard		*wl_keyboard;
     int				 grab;
     struct xwl_window		*focus_window;
     int32_t			 grab_x, grab_y;
diff --git a/hw/xfree86/xwayland/xwayland-window.c b/hw/xfree86/xwayland/xwayland-window.c
index c30fc08..63d3886 100644
--- a/hw/xfree86/xwayland/xwayland-window.c
+++ b/hw/xfree86/xwayland/xwayland-window.c
@@ -220,18 +220,18 @@ xwl_unrealize_window(WindowPtr window)
     ScreenPtr screen = window->drawable.pScreen;
     struct xwl_screen *xwl_screen;
     struct xwl_window *xwl_window;
-    struct xwl_input_device *xwl_input_device;
+    struct xwl_seat *xwl_seat;
     Bool ret;
 
     xwl_screen = xwl_screen_get(screen);
 
-    xorg_list_for_each_entry(xwl_input_device,
-			     &xwl_screen->input_device_list, link) {
-	if (!xwl_input_device->focus_window)
+    xorg_list_for_each_entry(xwl_seat,
+			     &xwl_screen->seat_list, link) {
+	if (!xwl_seat->focus_window)
 	    continue ;
-	if (xwl_input_device->focus_window->window == window) {
-	    xwl_input_device->focus_window = NULL;
-	    SetDeviceRedirectWindow(xwl_input_device->pointer, PointerRootWin);
+	if (xwl_seat->focus_window->window == window) {
+	    xwl_seat->focus_window = NULL;
+	    SetDeviceRedirectWindow(xwl_seat->pointer, PointerRootWin);
 	}
     }
 
diff --git a/hw/xfree86/xwayland/xwayland.c b/hw/xfree86/xwayland/xwayland.c
index 028f66d..d04c764 100644
--- a/hw/xfree86/xwayland/xwayland.c
+++ b/hw/xfree86/xwayland/xwayland.c
@@ -232,7 +232,7 @@ xwl_screen_pre_init(ScrnInfoPtr scrninfo,
 	return NULL;
     }
 
-    xorg_list_init(&xwl_screen->input_device_list);
+    xorg_list_init(&xwl_screen->seat_list);
     xorg_list_init(&xwl_screen->damage_window_list);
     xorg_list_init(&xwl_screen->window_list);
     xwl_screen->scrninfo = scrninfo;
@@ -304,7 +304,7 @@ xwl_create_window_buffer_shm(struct xwl_window *xwl_window,
 
 void xwl_screen_close(struct xwl_screen *xwl_screen)
 {
-    struct xwl_input_device *xwl_input_device, *itmp;
+    struct xwl_seat *xwl_seat, *itmp;
     struct xwl_window *xwl_window, *wtmp;
 
     if (xwl_screen->input_listener)
@@ -312,10 +312,10 @@ void xwl_screen_close(struct xwl_screen *xwl_screen)
 					  xwl_screen->input_listener);
 
 
-    xorg_list_for_each_entry_safe(xwl_input_device, itmp,
-				  &xwl_screen->input_device_list, link) {
-	wl_input_device_destroy(xwl_input_device->input_device);
-	free(xwl_input_device);
+    xorg_list_for_each_entry_safe(xwl_seat, itmp,
+				  &xwl_screen->seat_list, link) {
+	wl_seat_destroy(xwl_seat->seat);
+	free(xwl_seat);
     }
     xorg_list_for_each_entry_safe(xwl_window, wtmp,
 				  &xwl_screen->window_list, link) {
@@ -325,7 +325,7 @@ void xwl_screen_close(struct xwl_screen *xwl_screen)
     }
 
     xwl_screen->input_listener = NULL;
-    xorg_list_init(&xwl_screen->input_device_list);
+    xorg_list_init(&xwl_screen->seat_list);
     xorg_list_init(&xwl_screen->damage_window_list);
     xorg_list_init(&xwl_screen->window_list);
     xwl_screen->root_x = 0;
commit cd3074c8b3d188dd503c7aa13e51b044e54f0db3
Author: Tiago Vignatti <tiago.vignatti at intel.com>
Date:   Tue May 15 19:19:56 2012 +0300

    Xi: fix master device picking on SetDeviceRedirectWindow
    
    It was messing all Enter/LeaveNotify logic in a way that the server wasn't
    delivering those events anymore to clients of xwayland. The same was sometimes
    causing segfaults on the server, due clients not clearing properly
    PointerWindows pointer:
    
    Program received signal SIGSEGV, Segmentation fault.
    0x000000000044314f in IsParent (a=0x241e0b0, b=0x21) at events.c:974
    974         for (b = b->parent; b; b = b->parent)
    (gdb) bt
     #0  0x000000000044314f in IsParent (a=0x241e0b0, b=0x21) at events.c:974
     #1  0x0000000000440345 in CoreFocusOutNotifyPointerEvents (dev=0x24283a0,
         pwin_parent=0x241e0b0, exclude=0x2584720, mode=0, inclusive=0)
         at enterleave.c:773
     #2  0x0000000000440846 in CoreFocusToDescendant (dev=0x24283a0, A=0x241e0b0,
         B=0x2584720, mode=0) at enterleave.c:1019
     #3  0x0000000000441016 in CoreFocusEvents (dev=0x24283a0, from=0x241e0b0,
         to=0x2584720, mode=0) at enterleave.c:1245
     #4  0x0000000000441775 in DoFocusEvents (pDev=0x24283a0, from=0x241e0b0,
         to=0x2584720, mode=0) at enterleave.c:1390
     #5  0x000000000044bb19 in SetInputFocus (client=0x257e8d0, dev=0x24283a0,
         focusID=6291578, revertTo=1 '\001', ctime=0, followOK=0) at events.c:4869
     #6  0x000000000044bc9f in ProcSetInputFocus (client=0x257e8d0) at events.c:4911
     #7  0x0000000000430838 in Dispatch () at dispatch.c:439
     #8  0x0000000000421725 in main (argc=8, argv=0x7fffffffdd38,
         envp=0x7fffffffdd80) at main.c:287
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 477159e..0647a7e 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1921,7 +1921,7 @@ SetDeviceRedirectWindow(DeviceIntPtr dev, WindowPtr window)
     SpritePtr pSprite = dev->spriteInfo->sprite;
     DeviceIntPtr mouse;
 
-    mouse = IsMaster(dev) ? GetMaster(dev, MASTER_POINTER) : dev;
+    mouse = IsMaster(dev) ? dev : GetMaster(dev, MASTER_POINTER);
 
     pSprite->redirectWindow = window;
 


More information about the xorg-commit mailing list