diff options
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index ca13def7..293b5c58 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -817,6 +817,14 @@ static void view_child_handle_surface_unmap(struct wl_listener *listener, | |||
817 | child->mapped = false; | 817 | child->mapped = false; |
818 | } | 818 | } |
819 | 819 | ||
820 | static void view_child_handle_view_unmap(struct wl_listener *listener, | ||
821 | void *data) { | ||
822 | struct sway_view_child *child = | ||
823 | wl_container_of(listener, child, view_unmap); | ||
824 | view_child_damage(child, true); | ||
825 | child->mapped = false; | ||
826 | } | ||
827 | |||
820 | void view_child_init(struct sway_view_child *child, | 828 | void view_child_init(struct sway_view_child *child, |
821 | const struct sway_view_child_impl *impl, struct sway_view *view, | 829 | const struct sway_view_child_impl *impl, struct sway_view *view, |
822 | struct wlr_surface *surface) { | 830 | struct wlr_surface *surface) { |
@@ -837,6 +845,9 @@ void view_child_init(struct sway_view_child *child, | |||
837 | child->surface_map.notify = view_child_handle_surface_map; | 845 | child->surface_map.notify = view_child_handle_surface_map; |
838 | child->surface_unmap.notify = view_child_handle_surface_unmap; | 846 | child->surface_unmap.notify = view_child_handle_surface_unmap; |
839 | 847 | ||
848 | wl_signal_add(&view->events.unmap, &child->view_unmap); | ||
849 | child->view_unmap.notify = view_child_handle_view_unmap; | ||
850 | |||
840 | struct sway_output *output = child->view->container->workspace->output; | 851 | struct sway_output *output = child->view->container->workspace->output; |
841 | wlr_surface_send_enter(child->surface, output->wlr_output); | 852 | wlr_surface_send_enter(child->surface, output->wlr_output); |
842 | 853 | ||
@@ -850,6 +861,7 @@ void view_child_destroy(struct sway_view_child *child) { | |||
850 | 861 | ||
851 | wl_list_remove(&child->surface_commit.link); | 862 | wl_list_remove(&child->surface_commit.link); |
852 | wl_list_remove(&child->surface_destroy.link); | 863 | wl_list_remove(&child->surface_destroy.link); |
864 | wl_list_remove(&child->view_unmap.link); | ||
853 | 865 | ||
854 | if (child->impl && child->impl->destroy) { | 866 | if (child->impl && child->impl->destroy) { |
855 | child->impl->destroy(child); | 867 | child->impl->destroy(child); |