summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-06-19 22:15:32 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-06-25 15:17:13 +0200
commitbe2ca667352b4cb86fb4b14bed56105effc7d8fc (patch)
tree1b08afa7f4792b025069754b694f9e849c4fde18
parent2df807549e0112cf4426d1fee89a5ea44eb676c0 (diff)
downloadmutter-be2ca667352b4cb86fb4b14bed56105effc7d8fc.tar.gz
wayland: Export meta_wayland_touch_cancel()
This will be necessary in order to hook the gesture tracker to clients.
-rw-r--r--src/wayland/meta-wayland-touch.c47
-rw-r--r--src/wayland/meta-wayland-touch.h2
2 files changed, 25 insertions, 24 deletions
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index a91ee2443..b57ffe332 100644
--- a/src/wayland/meta-wayland-touch.c
+++ b/src/wayland/meta-wayland-touch.c
@@ -444,29 +444,6 @@ touch_info_free (MetaWaylandTouchInfo *touch_info)
g_free (touch_info);
}
-static void
-touch_handle_cancel_event (MetaWaylandTouch *touch,
- struct libinput_event *event)
-{
- GList *surfaces, *s;
-
- surfaces = s = touch_get_surfaces (touch, FALSE);
-
- while (s)
- {
- MetaWaylandTouchSurface *touch_surface = s->data;
- struct wl_resource *resource;
- struct wl_list *l;
-
- l = &touch_surface->resource_list;
- wl_resource_for_each(resource, l)
- wl_touch_send_cancel (resource);
- }
-
- g_hash_table_remove_all (touch->touches);
- g_list_free (surfaces);
-}
-
static gboolean
evdev_filter_func (struct libinput_event *event,
gpointer data)
@@ -495,7 +472,7 @@ evdev_filter_func (struct libinput_event *event,
* which are not so useful when sending a global signal as the protocol
* requires.
*/
- touch_handle_cancel_event (touch, event);
+ meta_wayland_touch_cancel (touch);
break;
default:
break;
@@ -546,3 +523,25 @@ meta_wayland_touch_create_new_resource (MetaWaylandTouch *touch,
wl_resource_set_implementation (cr, NULL, touch, unbind_resource);
wl_list_insert (&touch->resource_list, wl_resource_get_link (cr));
}
+
+void
+meta_wayland_touch_cancel (MetaWaylandTouch *touch)
+{
+ GList *surfaces, *s;
+
+ surfaces = s = touch_get_surfaces (touch, FALSE);
+
+ while (s)
+ {
+ MetaWaylandTouchSurface *touch_surface = s->data;
+ struct wl_resource *resource;
+ struct wl_list *l;
+
+ l = &touch_surface->resource_list;
+ wl_resource_for_each(resource, l)
+ wl_touch_send_cancel (resource);
+ }
+
+ g_hash_table_remove_all (touch->touches);
+ g_list_free (surfaces);
+}
diff --git a/src/wayland/meta-wayland-touch.h b/src/wayland/meta-wayland-touch.h
index 584695588..011e724be 100644
--- a/src/wayland/meta-wayland-touch.h
+++ b/src/wayland/meta-wayland-touch.h
@@ -58,5 +58,7 @@ void meta_wayland_touch_create_new_resource (MetaWaylandTouch *touch,
struct wl_client *client,
struct wl_resource *seat_resource,
uint32_t id);
+void meta_wayland_touch_cancel (MetaWaylandTouch *touch);
+
#endif /* META_WAYLAND_TOUCH_H */