diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 19aa14a47..9b1d85674 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -265,6 +265,9 @@ xwl_close_screen(ScreenPtr screen) 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); @@ -324,6 +327,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;