From 9f617ae43dd0511b16387082b0ef7e59543280ac Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 12 Sep 2019 19:17:06 +0200 Subject: [PATCH] wayland: Warn if a surface is being set while the pointer is invisible This is an unexpected condition, better not to fall in it without further indications. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/779 --- src/wayland/meta-wayland-pointer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 334349e30..e8f0be4c6 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -887,6 +887,11 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer, MetaWaylandSurface *surface) { MetaWaylandInputDevice *input_device = META_WAYLAND_INPUT_DEVICE (pointer); + MetaBackend *backend = meta_get_backend (); + MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend); + + g_return_if_fail (meta_cursor_tracker_get_pointer_visible (cursor_tracker) || + surface == NULL); if (pointer->focus_surface == surface) return;