mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 18:40:40 -05:00
wayland/pointer: Check for subsurfaces when grabbing
Previously, the function only returned `TRUE` if the given surface was equal to the given pointer's focused surface. This changes the behaviour to also return `TRUE` if any of the given surface's subsurfaces are equal to the pointer's focused surface. https://bugzilla.gnome.org/show_bug.cgi?id=781811
This commit is contained in:
parent
0f7c3f3678
commit
e22c75377b
@ -1162,13 +1162,33 @@ meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
if (pointer->focus_surface == surface)
|
||||
return TRUE;
|
||||
|
||||
for (l = surface->subsurfaces; l; l = l->next)
|
||||
{
|
||||
MetaWaylandSurface *subsurface = l->data;
|
||||
|
||||
if (pointer_can_grab_surface (pointer, subsurface))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial)
|
||||
{
|
||||
return (pointer->grab_serial == serial &&
|
||||
pointer->focus_surface == surface);
|
||||
pointer_can_grab_surface (pointer, surface));
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user