mirror of
https://github.com/brl/mutter.git
synced 2025-06-19 19:44:16 +00:00
wayland: Replace manual GNode subsurface iteration with macro
Similar to wl_list_foreach(), add META_WAYLAND_SURFACE_FOREACH_SUBSURFACE() that iterates over all the subsurfaces of a surface, without the caller needing to care about implementation details, such as leaf nodes vs non-leaf nodes. https://gitlab.gnome.org/GNOME/mutter/merge_requests/961
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
76ee026caa
commit
fcfe90aa9f
@ -1205,20 +1205,13 @@ static gboolean
|
||||
pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
GNode *n;
|
||||
MetaWaylandSurface *subsurface;
|
||||
|
||||
if (pointer->focus_surface == surface)
|
||||
return TRUE;
|
||||
|
||||
for (n = g_node_first_child (surface->subsurface_branch_node);
|
||||
n;
|
||||
n = g_node_next_sibling (n))
|
||||
META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (surface, subsurface)
|
||||
{
|
||||
MetaWaylandSurface *subsurface = n->data;
|
||||
|
||||
if (G_NODE_IS_LEAF (n))
|
||||
continue;
|
||||
|
||||
if (pointer_can_grab_surface (pointer, subsurface))
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user