wayland/pointer: Use glib signals tracking focus surface

Use the "destroy" MetaWaylandSurface signal instead of the wl_resource
destroy signal for tracking the lifetime of the surface with pointer
focus.

As unsetting the focus may have side effects due to handlers of the
"focus-surface-changed" signal, connect the signal after the default
handler to make sure other clean up facilities have the chance deal with
the surface destruction before we try to unset the focus.

https://bugzilla.gnome.org/show_bug.cgi?id=783113
This commit is contained in:
Jonas Ådahl
2017-05-31 17:24:07 +08:00
parent e9c9ee844c
commit b19e4592df
2 changed files with 16 additions and 14 deletions

View File

@ -71,7 +71,7 @@ struct _MetaWaylandPointer
GHashTable *pointer_clients;
MetaWaylandSurface *focus_surface;
struct wl_listener focus_surface_listener;
gulong focus_surface_destroyed_handler_id;
guint32 focus_serial;
guint32 click_serial;