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 14cc07d9..4759c998 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -820,6 +820,14 @@ static void view_child_handle_surface_unmap(struct wl_listener *listener, | |||
820 | child->mapped = false; | 820 | child->mapped = false; |
821 | } | 821 | } |
822 | 822 | ||
823 | static void view_child_handle_view_unmap(struct wl_listener *listener, | ||
824 | void *data) { | ||
825 | struct sway_view_child *child = | ||
826 | wl_container_of(listener, child, view_unmap); | ||
827 | view_child_damage(child, true); | ||
828 | child->mapped = false; | ||
829 | } | ||
830 | |||
823 | void view_child_init(struct sway_view_child *child, | 831 | void view_child_init(struct sway_view_child *child, |
824 | const struct sway_view_child_impl *impl, struct sway_view *view, | 832 | const struct sway_view_child_impl *impl, struct sway_view *view, |
825 | struct wlr_surface *surface) { | 833 | struct wlr_surface *surface) { |
@@ -840,6 +848,9 @@ void view_child_init(struct sway_view_child *child, | |||
840 | child->surface_map.notify = view_child_handle_surface_map; | 848 | child->surface_map.notify = view_child_handle_surface_map; |
841 | child->surface_unmap.notify = view_child_handle_surface_unmap; | 849 | child->surface_unmap.notify = view_child_handle_surface_unmap; |
842 | 850 | ||
851 | wl_signal_add(&view->events.unmap, &child->view_unmap); | ||
852 | child->view_unmap.notify = view_child_handle_view_unmap; | ||
853 | |||
843 | struct sway_output *output = child->view->container->workspace->output; | 854 | struct sway_output *output = child->view->container->workspace->output; |
844 | wlr_surface_send_enter(child->surface, output->wlr_output); | 855 | wlr_surface_send_enter(child->surface, output->wlr_output); |
845 | 856 | ||
@@ -853,6 +864,7 @@ void view_child_destroy(struct sway_view_child *child) { | |||
853 | 864 | ||
854 | wl_list_remove(&child->surface_commit.link); | 865 | wl_list_remove(&child->surface_commit.link); |
855 | wl_list_remove(&child->surface_destroy.link); | 866 | wl_list_remove(&child->surface_destroy.link); |
867 | wl_list_remove(&child->view_unmap.link); | ||
856 | 868 | ||
857 | if (child->impl && child->impl->destroy) { | 869 | if (child->impl && child->impl->destroy) { |
858 | child->impl->destroy(child); | 870 | child->impl->destroy(child); |