input: Keep per client pointer resources in their own structs
Keep all per client wl_pointer resources in a new struct called
'weston_pointer_client'. When focus changes, instead of moving a list
of resources between different lists, just change the focused pointer
client.
The intention with this is to make it easier to add wl_pointer
extensions that share the same focus as the corresponding wl_pointer.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/src/compositor.h b/src/compositor.h
index 44d9f86..203c2fd 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -327,12 +327,19 @@
void (*cancel)(struct weston_data_source *source);
};
+struct weston_pointer_client {
+ struct wl_list link;
+ struct wl_client *client;
+ struct wl_list pointer_resources;
+};
+
struct weston_pointer {
struct weston_seat *seat;
- struct wl_list resource_list;
- struct wl_list focus_resource_list;
+ struct wl_list pointer_clients;
+
struct weston_view *focus;
+ struct weston_pointer_client *focus_client;
uint32_t focus_serial;
struct wl_listener focus_view_listener;
struct wl_listener focus_resource_listener;