aboutsummaryrefslogtreecommitdiff
path: root/rootston/xwayland.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-20 18:05:24 +0100
committeremersion <contact@emersion.fr>2017-11-20 18:05:24 +0100
commit6a06c3d9073507168df370f9f58642ce2eae1825 (patch)
tree51b1e257d8b53288990adffebf96f37567ed8024 /rootston/xwayland.c
parentc3e0fbdb8f0cb16d99e70d14bb5cef6bd48d4591 (diff)
Fix segfault when closing xwayland views
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r--rootston/xwayland.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index c92c424b..dfa602b1 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -95,6 +95,8 @@ static void maximize(struct roots_view *view, bool maximized) {
static void handle_destroy(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, destroy);
+ struct wlr_xwayland_surface *xwayland_surface =
+ roots_surface->view->xwayland_surface;
wl_list_remove(&roots_surface->destroy.link);
wl_list_remove(&roots_surface->request_configure.link);
wl_list_remove(&roots_surface->request_move.link);
@@ -102,6 +104,9 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&roots_surface->request_maximize.link);
wl_list_remove(&roots_surface->map_notify.link);
wl_list_remove(&roots_surface->unmap_notify.link);
+ if (xwayland_surface->mapped) {
+ wl_list_remove(&roots_surface->view->link);
+ }
view_destroy(roots_surface->view);
free(roots_surface);
}
@@ -243,6 +248,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
view->close = close;
roots_surface->view = view;
view_init(view, desktop);
+ wl_list_insert(&desktop->views, &view->link);
if (!surface->override_redirect) {
view_setup(view);