wayland: Add getter for the implicitly grabbed surface of a touch sequence

This will be used to implement the default MetaWaylandEventInterface at
MetaWaylandSeat.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3420>
This commit is contained in:
Carlos Garnacho 2023-11-14 23:25:35 +01:00
parent 20f7a60e11
commit a98f1b2764
2 changed files with 19 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);