pointer/keyboard: Make sure not to get stale on client resources as well

Both the pointer/keyboard resource and surface resource can be destroyed
at any point in the destruction process, so we need to have destroy
listeners on both. To make the code easier to follow, rename ->focus
to ->focus_surface at the same time, and rearrange the code so that
the two of them are always grouped together.
This commit is contained in:
Jasper St. Pierre
2014-02-18 18:00:26 -05:00
parent 414259a7f8
commit a364c2a96b
6 changed files with 96 additions and 52 deletions

View File

@@ -46,9 +46,11 @@ struct _MetaWaylandPointerGrab
struct _MetaWaylandPointer
{
struct wl_list resource_list;
MetaWaylandSurface *focus;
struct wl_resource *focus_resource;
MetaWaylandSurface *focus_surface;
struct wl_listener focus_surface_listener;
struct wl_resource *focus_resource;
struct wl_listener focus_resource_listener;
guint32 focus_serial;
guint32 click_serial;