diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c index 6d45b4b7b..37e1a611c 100644 --- a/src/wayland/meta-wayland-touch.c +++ b/src/wayland/meta-wayland-touch.c @@ -553,6 +553,25 @@ meta_wayland_touch_can_popup (MetaWaylandTouch *touch, return FALSE; } +static gboolean +touch_can_grab_surface (MetaWaylandTouchInfo *touch_info, + MetaWaylandSurface *surface) +{ + MetaWaylandSurface *subsurface; + + if (touch_info->touch_surface->surface == surface) + return TRUE; + + META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (&surface->output_state, + subsurface) + { + if (touch_can_grab_surface (touch_info, subsurface)) + return TRUE; + } + + return FALSE; +} + ClutterEventSequence * meta_wayland_touch_find_grab_sequence (MetaWaylandTouch *touch, MetaWaylandSurface *surface, @@ -571,7 +590,7 @@ meta_wayland_touch_find_grab_sequence (MetaWaylandTouch *touch, (gpointer*) &touch_info)) { if (touch_info->slot_serial == serial && - touch_info->touch_surface->surface == surface) + touch_can_grab_surface (touch_info, surface)) return sequence; }