aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2022-12-12 00:00:50 -0500
committerAlexander Orzechowski <alex@ozal.ski>2023-01-04 04:24:17 -0500
commit5f264a7d6c8af27d41ff440c05262b022c055593 (patch)
tree91e52064623dcf33ef2e5c498cca0fcb42789f51
parent84aee1d70817c71fb211a3afeae92f383fc48c93 (diff)
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.
-rw-r--r--types/wlr_subcompositor.c13
1 files 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);
}
}