From 017a7c4da169ace601f282c87a9aaabc138a34d3 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Sat, 9 Mar 2019 02:23:20 -0500 Subject: sway_view_child: add listener for view unmap Since not all child views's have an unmap event, it is possible for it to still be mapped (default state) in the destruction handler. When the destruction handler is called, the corresponding view may have already been freed and the memory location reallocated. This adds a listener for the view unmapping and removes the mapped status. This ensures that the child view is damaged due to destruction while the view still exists and not after. --- include/sway/tree/view.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sway/tree') diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 5cc9777b..ac203ac7 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -202,6 +202,7 @@ struct sway_view_child { struct wl_listener surface_map; struct wl_listener surface_unmap; struct wl_listener surface_destroy; + struct wl_listener view_unmap; }; struct sway_subsurface { -- cgit v1.2.3-54-g00ecf