bar/wayland: don't try to set cursor surface if serial is 0

This commit is contained in:
Daniel Eklöf 2020-07-11 07:39:02 +02:00
parent 74933c40ee
commit e38f593acd
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -150,8 +150,12 @@ static const struct wl_shm_listener shm_listener = {
static void static void
update_cursor_surface(struct wayland_backend *backend, struct seat *seat) update_cursor_surface(struct wayland_backend *backend, struct seat *seat)
{ {
if (seat->pointer.cursor == NULL || seat->pointer.surface == NULL) if (seat->pointer.serial == 0 ||
seat->pointer.cursor == NULL ||
seat->pointer.surface == NULL)
{
return; return;
}
struct wl_cursor_image *image = seat->pointer.cursor->images[0]; struct wl_cursor_image *image = seat->pointer.cursor->images[0];