aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-06-05 19:13:31 +0300
committerKirill Primak <vyivel@eclair.cafe>2023-06-05 19:14:35 +0000
commit37b5f8a89e0705e8d050f0f93ce3e4f12d3d3d1a (patch)
treee1f3c7698750ca82c84ce5dc64aaa960c46163ec
parent4e513c93bd834bfe694c382cfe32108fbb8c8b33 (diff)
compositor: unmap subsurfaces too on unmap
Similar to 49e9be62ae92382eddca600082785489c82ea487.
-rw-r--r--types/wlr_compositor.c8
-rw-r--r--types/wlr_subcompositor.c17
2 files changed, 8 insertions, 17 deletions
diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c
index 689fa0da..9ef57cf8 100644
--- a/types/wlr_compositor.c
+++ b/types/wlr_compositor.c
@@ -754,6 +754,14 @@ void wlr_surface_unmap(struct wlr_surface *surface) {
if (surface->role != NULL && surface->role->unmap != NULL) {
surface->role->unmap(surface);
}
+
+ struct wlr_subsurface *subsurface;
+ wl_list_for_each(subsurface, &surface->current.subsurfaces_below, current.link) {
+ wlr_surface_unmap(subsurface->surface);
+ }
+ wl_list_for_each(subsurface, &surface->current.subsurfaces_above, current.link) {
+ wlr_surface_unmap(subsurface->surface);
+ }
}
bool wlr_surface_set_role(struct wlr_surface *surface,
diff --git a/types/wlr_subcompositor.c b/types/wlr_subcompositor.c
index a4ef2382..cb8a8d55 100644
--- a/types/wlr_subcompositor.c
+++ b/types/wlr_subcompositor.c
@@ -220,22 +220,6 @@ static void subsurface_role_commit(struct wlr_surface *surface) {
subsurface_consider_map(subsurface);
}
-static void subsurface_role_unmap(struct wlr_surface *surface) {
- struct wlr_subsurface *subsurface = wlr_subsurface_try_from_wlr_surface(surface);
- assert(subsurface != NULL);
-
- // Unmap all children
- struct wlr_subsurface *child;
- wl_list_for_each(child, &subsurface->surface->current.subsurfaces_below,
- current.link) {
- wlr_surface_unmap(child->surface);
- }
- wl_list_for_each(child, &subsurface->surface->current.subsurfaces_above,
- current.link) {
- wlr_surface_unmap(child->surface);
- }
-}
-
static void subsurface_role_destroy(struct wlr_surface *surface) {
struct wlr_subsurface *subsurface = wlr_subsurface_try_from_wlr_surface(surface);
assert(subsurface != NULL);
@@ -259,7 +243,6 @@ static void subsurface_role_destroy(struct wlr_surface *surface) {
const struct wlr_surface_role subsurface_role = {
.name = "wl_subsurface",
.commit = subsurface_role_commit,
- .unmap = subsurface_role_unmap,
.destroy = subsurface_role_destroy,
};