MetaWaylandPointer: Put client resources in its own struct

Instead of moving around all the bound pointer resources for a client
when changing focus, keep all the resources bound by a client in a per
client struct, and track the focus by having a pointer to the current
active pointer client struct instance.

This will simplify having wl_pointer extensinos sharing the pointer
focus of the wl_pointer by only having to add them to the pointer
client.

https://bugzilla.gnome.org/show_bug.cgi?id=744104
This commit is contained in:
Jonas Ådahl
2015-08-09 21:24:16 +08:00
committed by Carlos Garnacho
parent cba2ab445e
commit 1ee387bb31
3 changed files with 172 additions and 81 deletions

View File

@@ -44,12 +44,17 @@ struct _MetaWaylandPointerGrab
MetaWaylandPointer *pointer;
};
struct _MetaWaylandPointerClient
{
struct wl_list pointer_resources;
};
struct _MetaWaylandPointer
{
struct wl_display *display;
struct wl_list resource_list;
struct wl_list focus_resource_list;
MetaWaylandPointerClient *focus_client;
GHashTable *pointer_clients;
MetaWaylandSurface *focus_surface;
struct wl_listener focus_surface_listener;
@@ -127,4 +132,8 @@ gboolean meta_wayland_pointer_can_popup (MetaWaylandPointer *pointer,
MetaWaylandSurface *meta_wayland_pointer_get_top_popup (MetaWaylandPointer *pointer);
MetaWaylandPointerClient * meta_wayland_pointer_get_pointer_client (MetaWaylandPointer *pointer,
struct wl_client *client);
void meta_wayland_pointer_unbind_pointer_client_resource (struct wl_resource *resource);
#endif /* META_WAYLAND_POINTER_H */