aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index ac314795..d77bd07d 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -906,8 +906,18 @@ static void view_child_subsurface_create(struct sway_view_child *child,
906 view_child_damage(&subsurface->child, true); 906 view_child_damage(&subsurface->child, true);
907} 907}
908 908
909static bool view_child_is_mapped(struct sway_view_child *child) {
910 while (child) {
911 if (!child->mapped) {
912 return false;
913 }
914 child = child->parent;
915 }
916 return true;
917}
918
909static void view_child_damage(struct sway_view_child *child, bool whole) { 919static void view_child_damage(struct sway_view_child *child, bool whole) {
910 if (!child || !child->mapped || !child->view || !child->view->container) { 920 if (!child || !view_child_is_mapped(child) || !child->view || !child->view->container) {
911 return; 921 return;
912 } 922 }
913 int sx, sy; 923 int sx, sy;
@@ -1006,7 +1016,7 @@ void view_child_init(struct sway_view_child *child,
1006} 1016}
1007 1017
1008void view_child_destroy(struct sway_view_child *child) { 1018void view_child_destroy(struct sway_view_child *child) {
1009 if (child->mapped && child->view->container != NULL) { 1019 if (view_child_is_mapped(child) && child->view->container != NULL) {
1010 view_child_damage(child, true); 1020 view_child_damage(child, true);
1011 } 1021 }
1012 1022