diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 0e7929715..d0bdf36a4 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -159,6 +159,9 @@ xwl_window_from_window(WindowPtr window) static struct xwl_seat * xwl_screen_get_default_seat(struct xwl_screen *xwl_screen) { + if (xorg_list_is_empty(&xwl_screen->seat_list)) + return NULL; + return container_of(xwl_screen->seat_list.prev, struct xwl_seat, link); @@ -218,6 +221,10 @@ xwl_cursor_confined_to(DeviceIntPtr device, if (!xwl_seat) xwl_seat = xwl_screen_get_default_seat(xwl_screen); + /* xwl_seat hasn't been setup yet, don't do anything just yet */ + if (!xwl_seat) + return; + if (window == screen->root) { xwl_seat_unconfine_pointer(xwl_seat); return;