From dad9543c510ac9075533a7de9e8b315bd17b3b9c Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 15:56:26 +0100 Subject: [PATCH 01/13] Xwayland: remove xwm from selection seat listeners on destroy --- xwayland/xwm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 849acff8..0b9ffac2 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1114,6 +1114,10 @@ void xwm_destroy(struct wlr_xwm *xwm) { wl_list_for_each_safe(xsurface, tmp, &xwm->unpaired_surfaces, link) { wlr_xwayland_surface_destroy(xsurface); } + if (xwm->seat) { + wl_list_remove(&xwm->seat_selection.link); + wl_list_remove(&xwm->seat_primary_selection.link); + } wl_list_remove(&xwm->compositor_surface_create.link); xcb_disconnect(xwm->xcb_conn); From f8a346380c8d22a11c5acf72b74e35a6dca4f5a2 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 15:56:39 +0100 Subject: [PATCH 02/13] xwayland xwm_get_render_format: free reply --- xwayland/xwm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 0b9ffac2..facc5566 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1274,10 +1274,12 @@ static void xwm_get_render_format(struct wlr_xwm *xwm) { if (format == NULL) { wlr_log(L_DEBUG, "No 32 bit render format"); + free(reply); return; } xwm->render_format_id = format->id; + free(reply); } void xwm_set_cursor(struct wlr_xwm *xwm, const uint8_t *pixels, uint32_t stride, From bb0d888f2500290693232704c2a477cf321cdec6 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 16:30:59 +0100 Subject: [PATCH 03/13] xwayland selection: further cleanup on Xwayland exit This is necessary if our last primary/clipboard selection was on Xwayland, and we try to paste to native wayland after Xwayland died --- include/wlr/xwm.h | 1 + xwayland/selection.c | 24 ++++++++++++++++++++++++ xwayland/xwm.c | 8 +------- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/include/wlr/xwm.h b/include/wlr/xwm.h index cbc2f132..35c43b18 100644 --- a/include/wlr/xwm.h +++ b/include/wlr/xwm.h @@ -108,6 +108,7 @@ void xwm_set_cursor(struct wlr_xwm *xwm, const uint8_t *pixels, uint32_t stride, int xwm_handle_selection_event(struct wlr_xwm *xwm, xcb_generic_event_t *event); void xwm_selection_init(struct wlr_xwm *xwm); +void xwm_selection_finish(struct wlr_xwm *xwm); void xwm_set_seat(struct wlr_xwm *xwm, struct wlr_seat *seat); diff --git a/xwayland/selection.c b/xwayland/selection.c index 00e45182..79819565 100644 --- a/xwayland/selection.c +++ b/xwayland/selection.c @@ -826,6 +826,30 @@ void xwm_selection_init(struct wlr_xwm *xwm) { selection_init(xwm, &xwm->primary_selection, xwm->atoms[PRIMARY]); } +void xwm_selection_finish(struct wlr_xwm *xwm) { + if (!xwm) { + return; + } + if (xwm->selection_window) { + xcb_destroy_window(xwm->xcb_conn, xwm->selection_window); + } + if (xwm->seat) { + if (xwm->seat->selection_source && + xwm->seat->selection_source->cancel == data_source_cancel) { + wlr_seat_set_selection(xwm->seat, NULL, + wl_display_next_serial(xwm->xwayland->wl_display)); + } + if (xwm->seat->primary_selection_source && + xwm->seat->primary_selection_source->cancel == primary_selection_source_cancel) { + wlr_seat_set_primary_selection(xwm->seat, NULL, + wl_display_next_serial(xwm->xwayland->wl_display)); + } + wl_list_remove(&xwm->seat_selection.link); + wl_list_remove(&xwm->seat_primary_selection.link); + } + +} + static void xwm_selection_set_owner(struct wlr_xwm_selection *selection, bool set) { if (set) { diff --git a/xwayland/xwm.c b/xwayland/xwm.c index facc5566..5b710b85 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1092,9 +1092,7 @@ void xwm_destroy(struct wlr_xwm *xwm) { if (!xwm) { return; } - if (xwm->selection_window) { - xcb_destroy_window(xwm->xcb_conn, xwm->selection_window); - } + xwm_selection_finish(xwm); if (xwm->cursor) { xcb_free_cursor(xwm->xcb_conn, xwm->cursor); } @@ -1114,10 +1112,6 @@ void xwm_destroy(struct wlr_xwm *xwm) { wl_list_for_each_safe(xsurface, tmp, &xwm->unpaired_surfaces, link) { wlr_xwayland_surface_destroy(xsurface); } - if (xwm->seat) { - wl_list_remove(&xwm->seat_selection.link); - wl_list_remove(&xwm->seat_primary_selection.link); - } wl_list_remove(&xwm->compositor_surface_create.link); xcb_disconnect(xwm->xcb_conn); From 61b91a5721e87f0a102e234f87727acf8bee55c6 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 17:33:11 +0100 Subject: [PATCH 04/13] xwayland restart: copy seat and events over This is very ugly, there must be a better way to do that (not memset it?) Meanwhile, this fixes rootston xwayland on restart --- xwayland/xwayland.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 6dc71689..a0b6d1c3 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -169,6 +169,14 @@ static void handle_client_destroy(struct wl_listener *listener, void *data) { struct wlr_xwayland *wlr_xwayland = wl_container_of(listener, wlr_xwayland, client_destroy); + struct wlr_seat *seat = wlr_xwayland->seat; + struct wl_list new_surface_signals; + struct wl_listener *new_surface_listener, *next; + wl_list_init(&new_surface_signals); + wl_list_for_each_safe(new_surface_listener, next, &wlr_xwayland->events.new_surface.listener_list, link) { + wl_list_remove(&new_surface_listener->link); + wl_list_insert(&new_surface_signals, &new_surface_listener->link); + } // Don't call client destroy: it's being destroyed already wlr_xwayland->client = NULL; wl_list_remove(&wlr_xwayland->client_destroy.link); @@ -179,6 +187,13 @@ static void handle_client_destroy(struct wl_listener *listener, void *data) { wlr_log(L_INFO, "Restarting Xwayland"); wlr_xwayland_init(wlr_xwayland, wlr_xwayland->wl_display, wlr_xwayland->compositor); + wl_list_for_each_safe(new_surface_listener, next, &new_surface_signals, link) { + wl_list_remove(&new_surface_listener->link); + wl_signal_add(&wlr_xwayland->events.new_surface, new_surface_listener); + } + if (seat) { + wlr_xwayland_set_seat(wlr_xwayland, seat); + } } } From 58488ec5ce9254334bf3cfef986dfd7deeb62549 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 17:55:03 +0100 Subject: [PATCH 05/13] wlr_seat: add destroy signal --- include/wlr/types/wlr_seat.h | 2 ++ types/wlr_seat.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index f7dea52f..e049d4c7 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -207,6 +207,8 @@ struct wlr_seat { struct wl_signal selection; struct wl_signal primary_selection; + + struct wl_signal destroy; } events; void *data; diff --git a/types/wlr_seat.c b/types/wlr_seat.c index 2a79f784..40143723 100644 --- a/types/wlr_seat.c +++ b/types/wlr_seat.c @@ -348,6 +348,8 @@ void wlr_seat_destroy(struct wlr_seat *wlr_seat) { return; } + wl_signal_emit(&wlr_seat->events.destroy, NULL); + wl_list_remove(&wlr_seat->display_destroy.link); struct wlr_seat_client *client, *tmp; @@ -453,6 +455,8 @@ struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name) { wl_signal_init(&wlr_seat->events.touch_grab_begin); wl_signal_init(&wlr_seat->events.touch_grab_end); + wl_signal_init(&wlr_seat->events.destroy); + wlr_seat->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &wlr_seat->display_destroy); From e0eafa04293496b95f29fdaf42703f1fc1e29e2e Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 17:55:16 +0100 Subject: [PATCH 06/13] xwayland: listen to wlr_seat destroy signal --- include/wlr/xwayland.h | 1 + xwayland/xwayland.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index 8d71a7ab..d4590f97 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -28,6 +28,7 @@ struct wlr_xwayland { struct wl_event_source *sigusr1_source; struct wl_listener client_destroy; struct wl_listener display_destroy; + struct wl_listener seat_destroy; struct wlr_xwm *xwm; struct wlr_xwayland_cursor *cursor; diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index a0b6d1c3..e181d261 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -134,6 +134,7 @@ static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland) { free(wlr_xwayland->cursor); } + wlr_xwayland_set_seat(wlr_xwayland, NULL); xwm_destroy(wlr_xwayland->xwm); if (wlr_xwayland->client) { @@ -388,11 +389,30 @@ void wlr_xwayland_set_cursor(struct wlr_xwayland *wlr_xwayland, wlr_xwayland->cursor->hotspot_y = hotspot_y; } +static void wlr_xwayland_handle_seat_destroy(struct wl_listener *listener, + void *data) { + struct wlr_xwayland *xwayland = + wl_container_of(listener, xwayland, seat_destroy); + + wlr_xwayland_set_seat(xwayland, NULL); +} + void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland, struct wlr_seat *seat) { + if (xwayland->seat) { + wl_list_remove(&xwayland->seat_destroy.link); + } + xwayland->seat = seat; if (xwayland->xwm) { xwm_set_seat(xwayland->xwm, seat); } + + if (seat == NULL) { + return; + } + + xwayland->seat_destroy.notify = wlr_xwayland_handle_seat_destroy; + wl_signal_add(&seat->events.destroy, &xwayland->seat_destroy); } From 689004ff211d4c20ad0b802af14add6a9a761362 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 19:00:51 +0100 Subject: [PATCH 07/13] rootston seat: implement part of roots_seat_destroy ... and have it listen to seat destroy notifier --- include/rootston/seat.h | 2 ++ rootston/seat.c | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/rootston/seat.h b/include/rootston/seat.h index 7822bb70..cf5dd3b2 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -21,6 +21,8 @@ struct roots_seat { struct wl_list pointers; struct wl_list touch; struct wl_list tablet_tools; + + struct wl_listener seat_destroy; }; struct roots_seat_view { diff --git a/rootston/seat.c b/rootston/seat.c index c2c7e3ea..b0bb87e8 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -220,6 +220,27 @@ static void roots_seat_init_cursor(struct roots_seat *seat) { seat->cursor->request_set_cursor.notify = handle_request_set_cursor; } +static void seat_view_destroy(struct roots_seat_view *seat_view); + +void roots_seat_destroy(struct roots_seat *seat) { + struct roots_seat_view *view, *nview; + + // TODO: probably more to be freed here + + wl_list_for_each_safe(view, nview, &seat->views, link) { + seat_view_destroy(view); + } + // Can be called from seat_destroy handler, so don't destroy seat +} + +static void roots_seat_handle_seat_destroy(struct wl_listener *listener, + void *data) { + struct roots_seat *seat = + wl_container_of(listener, seat, seat_destroy); + + roots_seat_destroy(seat); +} + struct roots_seat *roots_seat_create(struct roots_input *input, char *name) { struct roots_seat *seat = calloc(1, sizeof(struct roots_seat)); if (!seat) { @@ -254,11 +275,10 @@ struct roots_seat *roots_seat_create(struct roots_input *input, char *name) { wl_list_insert(&input->seats, &seat->link); - return seat; -} + seat->seat_destroy.notify = roots_seat_handle_seat_destroy; + wl_signal_add(&seat->seat->events.destroy, &seat->seat_destroy); -void roots_seat_destroy(struct roots_seat *seat) { - // TODO + return seat; } static void seat_add_keyboard(struct roots_seat *seat, From d7cefccaeeb1a48fec41649b5b1b6dc25095e4c8 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 20:29:40 +0100 Subject: [PATCH 08/13] wlr_seat_destroy: emit seat itself as data on destroy event --- types/wlr_seat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_seat.c b/types/wlr_seat.c index 40143723..f9e2db5f 100644 --- a/types/wlr_seat.c +++ b/types/wlr_seat.c @@ -348,7 +348,7 @@ void wlr_seat_destroy(struct wlr_seat *wlr_seat) { return; } - wl_signal_emit(&wlr_seat->events.destroy, NULL); + wl_signal_emit(&wlr_seat->events.destroy, wlr_seat); wl_list_remove(&wlr_seat->display_destroy.link); From 41649a1f9a37379f470dad34aa81bbb13d8b70c1 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 20:30:49 +0100 Subject: [PATCH 09/13] xwm_selection_finish: set NULL seat for xwayland While they could eventually be split appart, the current approach could lead to double wl_list_remove() calls on selections which is incorrect --- xwayland/selection.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xwayland/selection.c b/xwayland/selection.c index 79819565..65599145 100644 --- a/xwayland/selection.c +++ b/xwayland/selection.c @@ -844,8 +844,7 @@ void xwm_selection_finish(struct wlr_xwm *xwm) { wlr_seat_set_primary_selection(xwm->seat, NULL, wl_display_next_serial(xwm->xwayland->wl_display)); } - wl_list_remove(&xwm->seat_selection.link); - wl_list_remove(&xwm->seat_primary_selection.link); + wlr_xwayland_set_seat(xwm->xwayland, NULL); } } From a6fb4b007b4cd1abb406acb57efc041fba3d78f7 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 20:31:04 +0100 Subject: [PATCH 10/13] xwm_get_render_format: check NULL return value --- xwayland/xwm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 5b710b85..470c4e63 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1254,6 +1254,10 @@ static void xwm_get_render_format(struct wlr_xwm *xwm) { xcb_render_query_pict_formats(xwm->xcb_conn); xcb_render_query_pict_formats_reply_t *reply = xcb_render_query_pict_formats_reply(xwm->xcb_conn, cookie, NULL); + if (!reply) { + wlr_log(L_ERROR, "Did not get any reply from xcb_rrender_query_pict_formats"); + return; + } xcb_render_pictforminfo_iterator_t iter = xcb_render_query_pict_formats_formats_iterator(reply); xcb_render_pictforminfo_t *format = NULL; From a477e5d302120805f1d6341c60d218ab9f77fc27 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 20:32:01 +0100 Subject: [PATCH 11/13] roots_seat_destroy: also destroy seat in public function Rework the functions a bit so that the handler does the bulk of the work except for destroying the seat itself, and the main public function just explicitely calls the handler and destroys the seat --- rootston/seat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rootston/seat.c b/rootston/seat.c index b0bb87e8..2728ca96 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -222,23 +222,23 @@ static void roots_seat_init_cursor(struct roots_seat *seat) { static void seat_view_destroy(struct roots_seat_view *seat_view); -void roots_seat_destroy(struct roots_seat *seat) { - struct roots_seat_view *view, *nview; +static void roots_seat_handle_seat_destroy(struct wl_listener *listener, + void *data) { + struct roots_seat *seat = + wl_container_of(listener, seat, seat_destroy); // TODO: probably more to be freed here + wl_list_remove(&seat->seat_destroy.link); + struct roots_seat_view *view, *nview; wl_list_for_each_safe(view, nview, &seat->views, link) { seat_view_destroy(view); } - // Can be called from seat_destroy handler, so don't destroy seat } -static void roots_seat_handle_seat_destroy(struct wl_listener *listener, - void *data) { - struct roots_seat *seat = - wl_container_of(listener, seat, seat_destroy); - - roots_seat_destroy(seat); +void roots_seat_destroy(struct roots_seat *seat) { + roots_seat_handle_seat_destroy(&seat->seat_destroy, seat->seat); + wlr_seat_destroy(seat->seat); } struct roots_seat *roots_seat_create(struct roots_input *input, char *name) { From ec952931a18cc21c99f20424b190590f9c769ae1 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 20:50:50 +0100 Subject: [PATCH 12/13] wlr_xwayland: preserve end of struct on restart This is more robust than trying to recopy a few fields. Note: wlr_xwayland->events.ready now resets after each trigger, so one can hook on it again and be called when restart is ready --- include/wlr/xwayland.h | 6 ++++-- xwayland/xwayland.c | 34 +++++++++++----------------------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index d4590f97..b6671de1 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -22,16 +22,18 @@ struct wlr_xwayland { struct wl_client *client; struct wl_display *wl_display; struct wlr_compositor *compositor; - struct wlr_seat *seat; time_t server_start; struct wl_event_source *sigusr1_source; struct wl_listener client_destroy; struct wl_listener display_destroy; - struct wl_listener seat_destroy; struct wlr_xwm *xwm; struct wlr_xwayland_cursor *cursor; + /* Anything above seat is reset on Xwayland restart, rest is conserved */ + struct wlr_seat *seat; + struct wl_listener seat_destroy; + struct { struct wl_signal ready; struct wl_signal new_surface; diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index e181d261..6c700cc5 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -134,7 +134,6 @@ static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland) { free(wlr_xwayland->cursor); } - wlr_xwayland_set_seat(wlr_xwayland, NULL); xwm_destroy(wlr_xwayland->xwm); if (wlr_xwayland->client) { @@ -163,21 +162,13 @@ static void wlr_xwayland_finish(struct wlr_xwayland *wlr_xwayland) { */ } -static bool wlr_xwayland_init(struct wlr_xwayland *wlr_xwayland, +static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, struct wl_display *wl_display, struct wlr_compositor *compositor); static void handle_client_destroy(struct wl_listener *listener, void *data) { struct wlr_xwayland *wlr_xwayland = wl_container_of(listener, wlr_xwayland, client_destroy); - struct wlr_seat *seat = wlr_xwayland->seat; - struct wl_list new_surface_signals; - struct wl_listener *new_surface_listener, *next; - wl_list_init(&new_surface_signals); - wl_list_for_each_safe(new_surface_listener, next, &wlr_xwayland->events.new_surface.listener_list, link) { - wl_list_remove(&new_surface_listener->link); - wl_list_insert(&new_surface_signals, &new_surface_listener->link); - } // Don't call client destroy: it's being destroyed already wlr_xwayland->client = NULL; wl_list_remove(&wlr_xwayland->client_destroy.link); @@ -186,15 +177,8 @@ static void handle_client_destroy(struct wl_listener *listener, void *data) { if (time(NULL) - wlr_xwayland->server_start > 5) { wlr_log(L_INFO, "Restarting Xwayland"); - wlr_xwayland_init(wlr_xwayland, wlr_xwayland->wl_display, + wlr_xwayland_start(wlr_xwayland, wlr_xwayland->wl_display, wlr_xwayland->compositor); - wl_list_for_each_safe(new_surface_listener, next, &new_surface_signals, link) { - wl_list_remove(&new_surface_listener->link); - wl_signal_add(&wlr_xwayland->events.new_surface, new_surface_listener); - } - if (seat) { - wlr_xwayland_set_seat(wlr_xwayland, seat); - } } } @@ -254,20 +238,20 @@ static int xserver_handle_ready(int signal_number, void *data) { setenv("DISPLAY", display_name, true); wl_signal_emit(&wlr_xwayland->events.ready, wlr_xwayland); + /* ready is a one-shot signal, fire and forget */ + wl_signal_init(&wlr_xwayland->events.ready); return 1; /* wayland event loop dispatcher's count */ } -static bool wlr_xwayland_init(struct wlr_xwayland *wlr_xwayland, +static bool wlr_xwayland_start(struct wlr_xwayland *wlr_xwayland, struct wl_display *wl_display, struct wlr_compositor *compositor) { - memset(wlr_xwayland, 0, sizeof(struct wlr_xwayland)); + memset(wlr_xwayland, 0, offsetof(struct wlr_xwayland, seat)); wlr_xwayland->wl_display = wl_display; wlr_xwayland->compositor = compositor; wlr_xwayland->x_fd[0] = wlr_xwayland->x_fd[1] = -1; wlr_xwayland->wl_fd[0] = wlr_xwayland->wl_fd[1] = -1; wlr_xwayland->wm_fd[0] = wlr_xwayland->wm_fd[1] = -1; - wl_signal_init(&wlr_xwayland->events.new_surface); - wl_signal_init(&wlr_xwayland->events.ready); wlr_xwayland->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(wl_display, &wlr_xwayland->display_destroy); @@ -352,6 +336,7 @@ static bool wlr_xwayland_init(struct wlr_xwayland *wlr_xwayland, } void wlr_xwayland_destroy(struct wlr_xwayland *wlr_xwayland) { + wlr_xwayland_set_seat(wlr_xwayland, NULL); wlr_xwayland_finish(wlr_xwayland); free(wlr_xwayland); } @@ -359,7 +344,10 @@ void wlr_xwayland_destroy(struct wlr_xwayland *wlr_xwayland) { struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display, struct wlr_compositor *compositor) { struct wlr_xwayland *wlr_xwayland = calloc(1, sizeof(struct wlr_xwayland)); - if (wlr_xwayland_init(wlr_xwayland, wl_display, compositor)) { + + wl_signal_init(&wlr_xwayland->events.new_surface); + wl_signal_init(&wlr_xwayland->events.ready); + if (wlr_xwayland_start(wlr_xwayland, wl_display, compositor)) { return wlr_xwayland; } free(wlr_xwayland); From 6ed1884c84f470707ed5e6b56a92d86b51034625 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 29 Dec 2017 21:23:55 +0100 Subject: [PATCH 13/13] xwm_get_render_format: fix typo in error message --- xwayland/xwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 470c4e63..53aac6a4 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1255,7 +1255,7 @@ static void xwm_get_render_format(struct wlr_xwm *xwm) { xcb_render_query_pict_formats_reply_t *reply = xcb_render_query_pict_formats_reply(xwm->xcb_conn, cookie, NULL); if (!reply) { - wlr_log(L_ERROR, "Did not get any reply from xcb_rrender_query_pict_formats"); + wlr_log(L_ERROR, "Did not get any reply from xcb_render_query_pict_formats"); return; } xcb_render_pictforminfo_iterator_t iter =