summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xwayland/xwayland-cursor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index 7d14a3d52..b2ae93ff9 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -76,6 +76,7 @@ static Bool
xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
{
PixmapPtr pixmap;
+ struct xwl_screen *xwl_screen;
struct xwl_seat *xwl_seat;
pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key);
@@ -85,9 +86,9 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, NULL);
/* When called from FreeCursor(), device is always NULL */
- if (device) {
- xwl_seat = device->public.devicePrivate;
- if (xwl_seat && cursor == xwl_seat->x_cursor)
+ xwl_screen = xwl_screen_get(screen);
+ xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) {
+ if (cursor == xwl_seat->x_cursor)
xwl_seat->x_cursor = NULL;
}