I think the right solution is to move the "session->destroy_surface(surface);" call from AbstractShell::destroy_surface() to <Policy>::handle_delete_surface(). (There are four of these, plus DefaultWindowManager::remove_surface() in playground.)
It seems like a PITA, but this allows the window management policy control over the point at which the surface and decorations are destroyed.
I think the right solution is to move the "session- >destroy_ surface( surface) ;" call from AbstractShell: :destroy_ surface( ) to <Policy> ::handle_ delete_ surface( ). (There are four of these, plus DefaultWindowMa nager:: remove_ surface( ) in playground.)
It seems like a PITA, but this allows the window management policy control over the point at which the surface and decorations are destroyed.