Fix crash when override redirect views close

This commit is contained in:
Drew DeVault 2018-03-30 00:46:40 -04:00
parent e62cc0ac26
commit 2d46050281

View file

@ -108,10 +108,9 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&sway_surface->commit.link); wl_list_remove(&sway_surface->commit.link);
wl_list_remove(&sway_surface->destroy.link); wl_list_remove(&sway_surface->destroy.link);
wl_list_remove(&sway_surface->request_configure.link); wl_list_remove(&sway_surface->request_configure.link);
if (xsurface->override_redirect) { if (xsurface->override_redirect && xsurface->mapped) {
if (xsurface->mapped) { wl_list_remove(&sway_surface->view->unmanaged_view_link);
wl_list_remove(&sway_surface->view->unmanaged_view_link); wl_list_init(&sway_surface->view->unmanaged_view_link);
}
} }
struct sway_container *parent = container_view_destroy(sway_surface->view->swayc); struct sway_container *parent = container_view_destroy(sway_surface->view->swayc);
@ -127,8 +126,9 @@ static void handle_unmap_notify(struct wl_listener *listener, void *data) {
struct sway_xwayland_surface *sway_surface = struct sway_xwayland_surface *sway_surface =
wl_container_of(listener, sway_surface, unmap_notify); wl_container_of(listener, sway_surface, unmap_notify);
struct wlr_xwayland_surface *xsurface = data; struct wlr_xwayland_surface *xsurface = data;
if (xsurface->override_redirect) { if (xsurface->override_redirect && xsurface->mapped) {
wl_list_remove(&sway_surface->view->unmanaged_view_link); wl_list_remove(&sway_surface->view->unmanaged_view_link);
wl_list_init(&sway_surface->view->unmanaged_view_link);
} }
// take it out of the tree // take it out of the tree