[mutter/wip/gestures: 14/14] wayland: Export meta_wayland_touch_cancel()



commit e7e2240c01905378b90a672886984f0c2eb2d1f6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 19 22:15:32 2014 +0200

    wayland: Export meta_wayland_touch_cancel()
    
    This will be necessary in order to hook the gesture tracker
    to clients.

 src/wayland/meta-wayland-touch.c |   47 ++++++++++++++++++-------------------
 src/wayland/meta-wayland-touch.h |    2 +
 2 files changed, 25 insertions(+), 24 deletions(-)
---
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index a91ee24..b57ffe3 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 5846955..011e724 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]