@ -820,6 +820,14 @@ static void view_child_handle_surface_unmap(struct wl_listener *listener,
child - > mapped = false ;
child - > mapped = false ;
}
}
static void view_child_handle_view_unmap ( struct wl_listener * listener ,
void * data ) {
struct sway_view_child * child =
wl_container_of ( listener , child , view_unmap ) ;
view_child_damage ( child , true ) ;
child - > mapped = false ;
}
void view_child_init ( struct sway_view_child * child ,
void view_child_init ( struct sway_view_child * child ,
const struct sway_view_child_impl * impl , struct sway_view * view ,
const struct sway_view_child_impl * impl , struct sway_view * view ,
struct wlr_surface * surface ) {
struct wlr_surface * surface ) {
@ -840,6 +848,9 @@ void view_child_init(struct sway_view_child *child,
child - > surface_map . notify = view_child_handle_surface_map ;
child - > surface_map . notify = view_child_handle_surface_map ;
child - > surface_unmap . notify = view_child_handle_surface_unmap ;
child - > surface_unmap . notify = view_child_handle_surface_unmap ;
wl_signal_add ( & view - > events . unmap , & child - > view_unmap ) ;
child - > view_unmap . notify = view_child_handle_view_unmap ;
struct sway_output * output = child - > view - > container - > workspace - > output ;
struct sway_output * output = child - > view - > container - > workspace - > output ;
wlr_surface_send_enter ( child - > surface , output - > wlr_output ) ;
wlr_surface_send_enter ( child - > surface , output - > wlr_output ) ;
@ -853,6 +864,7 @@ void view_child_destroy(struct sway_view_child *child) {
wl_list_remove ( & child - > surface_commit . link ) ;
wl_list_remove ( & child - > surface_commit . link ) ;
wl_list_remove ( & child - > surface_destroy . link ) ;
wl_list_remove ( & child - > surface_destroy . link ) ;
wl_list_remove ( & child - > view_unmap . link ) ;
if ( child - > impl & & child - > impl - > destroy ) {
if ( child - > impl & & child - > impl - > destroy ) {
child - > impl - > destroy ( child ) ;
child - > impl - > destroy ( child ) ;