aboutsummaryrefslogtreecommitdiff
path: root/xwayland/xwayland.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-08-23 23:11:44 +0200
committerDominique Martinet <asmadeus@codewreck.org>2017-08-24 07:51:24 +0200
commitfd3ad3b9e42d9f2d1196a5c36b07763283729053 (patch)
tree209015af1aadfe34dc3c847cb6a330ed8f641f53 /xwayland/xwayland.c
parent0196284331fc249293a9b6a74ba9f71ccdc681dd (diff)
xwayland: fix shutdown caused by Xwayland/client stop
Diffstat (limited to 'xwayland/xwayland.c')
-rw-r--r--xwayland/xwayland.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c
index a28073d8..9c0b1839 100644
--- a/xwayland/xwayland.c
+++ b/xwayland/xwayland.c
@@ -107,8 +107,7 @@ static bool wlr_xwayland_init(struct wlr_xwayland *wlr_xwayland,
static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland);
static void xwayland_destroy_event(struct wl_listener *listener, void *data) {
- struct wl_client *client = data;
- struct wlr_xwayland *wlr_xwayland = wl_container_of(client, wlr_xwayland, client);
+ struct wlr_xwayland *wlr_xwayland = wl_container_of(listener, wlr_xwayland, destroy_listener);
/* don't call client destroy */
wlr_xwayland->client = NULL;
@@ -120,13 +119,9 @@ static void xwayland_destroy_event(struct wl_listener *listener, void *data) {
}
}
-static struct wl_listener xwayland_destroy_listener = {
- .notify = xwayland_destroy_event,
-};
-
static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland) {
if (wlr_xwayland->client) {
- wl_list_remove(&xwayland_destroy_listener.link);
+ wl_list_remove(&wlr_xwayland->destroy_listener.link);
wl_client_destroy(wlr_xwayland->client);
}
@@ -224,7 +219,8 @@ static bool wlr_xwayland_init(struct wlr_xwayland *wlr_xwayland,
return false;
}
- wl_client_add_destroy_listener(wlr_xwayland->client, &xwayland_destroy_listener);
+ wlr_xwayland->destroy_listener.notify = xwayland_destroy_event;
+ wl_client_add_destroy_listener(wlr_xwayland->client, &wlr_xwayland->destroy_listener);
struct wl_event_loop *loop = wl_display_get_event_loop(wl_display);
wlr_xwayland->sigusr1_source = wl_event_loop_add_signal(loop, SIGUSR1, xserver_handle_ready, wlr_xwayland);