diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c index d75ced4cf..401abca85 100644 --- a/src/wayland/meta-wayland-touch.c +++ b/src/wayland/meta-wayland-touch.c @@ -637,6 +637,22 @@ meta_wayland_touch_get_press_coords (MetaWaylandTouch *touch, return TRUE; } +MetaWaylandSurface * +meta_wayland_touch_get_surface (MetaWaylandTouch *touch, + ClutterEventSequence *sequence) +{ + MetaWaylandTouchInfo *touch_info; + + if (!touch->touches) + return NULL; + + touch_info = touch_get_info (touch, sequence, FALSE); + if (!touch_info || !touch_info->touch_surface) + return NULL; + + return touch_info->touch_surface->surface; +} + static void meta_wayland_touch_init (MetaWaylandTouch *touch) { diff --git a/src/wayland/meta-wayland-touch.h b/src/wayland/meta-wayland-touch.h index ab2138adb..259cec7c5 100644 --- a/src/wayland/meta-wayland-touch.h +++ b/src/wayland/meta-wayland-touch.h @@ -73,3 +73,6 @@ gboolean meta_wayland_touch_get_press_coords (MetaWaylandTouch *touch, gboolean meta_wayland_touch_can_popup (MetaWaylandTouch *touch, uint32_t serial); + +MetaWaylandSurface * meta_wayland_touch_get_surface (MetaWaylandTouch *touch, + ClutterEventSequence *sequence);