From 5f264a7d6c8af27d41ff440c05262b022c055593 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 12 Dec 2022 00:00:50 -0500 Subject: subcompositor: Clean up subsurface_consider_map check_parent was unecessary: it only served to skip a trivial check and added more complexity than it was worth. --- types/wlr_subcompositor.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/types/wlr_subcompositor.c b/types/wlr_subcompositor.c index 75c928f8..6e8a67a6 100644 --- a/types/wlr_subcompositor.c +++ b/types/wlr_subcompositor.c @@ -192,13 +192,12 @@ static const struct wl_subsurface_interface subsurface_implementation = { * - The subsurface has a buffer * - Its parent is mapped */ -static void subsurface_consider_map(struct wlr_subsurface *subsurface, - bool check_parent) { +static void subsurface_consider_map(struct wlr_subsurface *subsurface) { if (subsurface->mapped || !wlr_surface_has_buffer(subsurface->surface)) { return; } - if (check_parent && wlr_surface_is_subsurface(subsurface->parent)) { + if (wlr_surface_is_subsurface(subsurface->parent)) { struct wlr_subsurface *parent = wlr_subsurface_from_wlr_surface(subsurface->parent); if (parent == NULL || !parent->mapped) { @@ -214,11 +213,11 @@ static void subsurface_consider_map(struct wlr_subsurface *subsurface, struct wlr_subsurface *child; wl_list_for_each(child, &subsurface->surface->current.subsurfaces_below, current.link) { - subsurface_consider_map(child, false); + subsurface_consider_map(child); } wl_list_for_each(child, &subsurface->surface->current.subsurfaces_above, current.link) { - subsurface_consider_map(child, false); + subsurface_consider_map(child); } } @@ -246,7 +245,7 @@ static void subsurface_role_commit(struct wlr_surface *surface) { struct wlr_subsurface *subsurface = wlr_subsurface_from_wlr_surface(surface); - subsurface_consider_map(subsurface, true); + subsurface_consider_map(subsurface); } static void subsurface_role_precommit(struct wlr_surface *surface, @@ -355,7 +354,7 @@ void subsurface_handle_parent_commit(struct wlr_subsurface *subsurface) { subsurface->added = true; wl_signal_emit_mutable(&subsurface->parent->events.new_subsurface, subsurface); - subsurface_consider_map(subsurface, true); + subsurface_consider_map(subsurface); } } -- cgit v1.2.3