From cfceaec266d4db68bd7f217adc31396e42eaf101 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 11 Jan 2020 00:05:21 -0600 Subject: wayland: don't set cursor before pointer id This shouldn't really matter, but it's probably best to avoid. vo_wayland_control would execute set_cursor_visibility while wl->pointer existed but it didn't check if wl->pointer_id existed. So wl_pointer_set_cursor would be set to a null surface with an id of 0. Instead, just wait until we have an actual, non-zero pointer id so that the cursor is set with the correct, actual id and not a fictious 0 id. This ensures that the pointer isn't set until it enters the wl_surface which is what we want. --- video/out/wayland_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/out') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index b8f359cca1..ce0b83c0e4 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -105,7 +105,7 @@ static int spawn_cursor(struct vo_wayland_state *wl) static int set_cursor_visibility(struct vo_wayland_state *wl, bool on) { - if (!wl->pointer) + if (!wl->pointer || !wl->pointer_id) return VO_NOTAVAIL; wl->cursor_visible = on; if (on) { -- cgit v1.2.3