aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/types/wlr_subcompositor.h1
-rw-r--r--types/wlr_compositor.c9
-rw-r--r--types/wlr_subcompositor.c3
3 files changed, 11 insertions, 2 deletions
diff --git a/include/types/wlr_subcompositor.h b/include/types/wlr_subcompositor.h
index fe2ab69d..147b2838 100644
--- a/include/types/wlr_subcompositor.h
+++ b/include/types/wlr_subcompositor.h
@@ -3,6 +3,7 @@
#include <wlr/types/wlr_subcompositor.h>
+void subsurface_consider_map(struct wlr_subsurface *subsurface);
void subsurface_handle_parent_commit(struct wlr_subsurface *subsurface);
#endif
diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c
index 3fb3f627..4e32f959 100644
--- a/types/wlr_compositor.c
+++ b/types/wlr_compositor.c
@@ -735,6 +735,15 @@ void wlr_surface_map(struct wlr_surface *surface) {
}
assert(wlr_surface_has_buffer(surface));
surface->mapped = true;
+
+ struct wlr_subsurface *subsurface;
+ wl_list_for_each(subsurface, &surface->current.subsurfaces_below, current.link) {
+ subsurface_consider_map(subsurface);
+ }
+ wl_list_for_each(subsurface, &surface->current.subsurfaces_above, current.link) {
+ subsurface_consider_map(subsurface);
+ }
+
wl_signal_emit_mutable(&surface->events.map, NULL);
}
diff --git a/types/wlr_subcompositor.c b/types/wlr_subcompositor.c
index 42c86064..a4ef2382 100644
--- a/types/wlr_subcompositor.c
+++ b/types/wlr_subcompositor.c
@@ -189,7 +189,7 @@ const struct wlr_surface_role subsurface_role;
* - The subsurface has a buffer
* - Its parent is mapped
*/
-static void subsurface_consider_map(struct wlr_subsurface *subsurface) {
+void subsurface_consider_map(struct wlr_subsurface *subsurface) {
if (subsurface->surface->mapped || !wlr_surface_has_buffer(subsurface->surface)) {
return;
}
@@ -329,7 +329,6 @@ 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);
}
}