summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-touch.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-09-12 23:20:36 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-09-15 09:55:34 +0800
commit87f82d9fc09245788a6d82303c67e600ff398f9a (patch)
treecad9a11e8a09c3ebfb0f53d13f712ead031220ca /src/wayland/meta-wayland-touch.c
parenta6646b32d0b078948bbb47e84037f09b5b6ff990 (diff)
downloadmutter-87f82d9fc09245788a6d82303c67e600ff398f9a.tar.gz
wayland: Move device seat association to MetaWaylandInputDevice
Make the device <-> seat association permanent, and move it into MetaWaylandInputDevice. A device will never be disassociated with a seat, so there is no point in unsetting it. https://bugzilla.gnome.org/show_bug.cgi?id=771305
Diffstat (limited to 'src/wayland/meta-wayland-touch.c')
-rw-r--r--src/wayland/meta-wayland-touch.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index d3793d516..78df0a7be 100644
--- a/src/wayland/meta-wayland-touch.c
+++ b/src/wayland/meta-wayland-touch.c
@@ -455,9 +455,11 @@ touch_info_free (MetaWaylandTouchInfo *touch_info)
void
meta_wayland_touch_cancel (MetaWaylandTouch *touch)
{
+ MetaWaylandInputDevice *input_device = META_WAYLAND_INPUT_DEVICE (touch);
+ MetaWaylandSeat *seat = meta_wayland_input_device_get_seat (input_device);
GList *surfaces, *s;
- if (touch->seat == NULL)
+ if (!meta_wayland_seat_has_touch (seat))
return;
surfaces = s = touch_get_surfaces (touch, FALSE);
@@ -517,12 +519,10 @@ evdev_filter_func (struct libinput_event *event,
#endif
void
-meta_wayland_touch_enable (MetaWaylandTouch *touch,
- MetaWaylandSeat *seat)
+meta_wayland_touch_enable (MetaWaylandTouch *touch)
{
ClutterDeviceManager *manager;
- touch->seat = seat;
touch->touch_surfaces = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) touch_surface_free);
touch->touches = g_hash_table_new_full (NULL, NULL, NULL,
@@ -551,7 +551,6 @@ meta_wayland_touch_disable (MetaWaylandTouch *touch)
g_clear_pointer (&touch->touch_surfaces, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&touch->touches, (GDestroyNotify) g_hash_table_unref);
- touch->seat = NULL;
}
void
@@ -560,9 +559,10 @@ meta_wayland_touch_create_new_resource (MetaWaylandTouch *touch,
struct wl_resource *seat_resource,
uint32_t id)
{
+ MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
struct wl_resource *cr;
- if (touch->seat == NULL)
+ if (!meta_wayland_seat_has_touch (seat))
{
wl_resource_post_error (seat_resource, WL_DISPLAY_ERROR_INVALID_METHOD,
"Cannot retrieve touch interface without touch capability");