summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/recipes-graphics/wayland/weston
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-core/recipes-graphics/wayland/weston')
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch30
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch60
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Migrate-weston_seat_init-release-to-public.patch106
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-add-weston_layer_fini.patch82
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-desktop-rename-weston_desktop_client_destr.patch51
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0002-libweston-desktop-introduce-weston_desktop_client_de.patch88
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0003-libweston-desktop-add-weston_desktop_xwayland_fini.patch99
7 files changed, 90 insertions, 426 deletions
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch
new file mode 100644
index 000000000..202333a5e
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch
@@ -0,0 +1,30 @@
+From 6a847464de9e773f6d1490916d0df48a0f90eeba Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Thu, 5 Oct 2023 16:27:34 +0300
+Subject: [PATCH] clients: Handle missing pointer_surface is there's no pointer
+ event
+
+Upstream-Status: Pending
+
+Bug-AGL: SPEC-4916
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ clients/window.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/clients/window.c b/clients/window.c
+index 30f6410..882e9d5 100644
+--- a/clients/window.c
++++ b/clients/window.c
+@@ -3818,7 +3818,7 @@ pointer_surface_frame_callback(void *data, struct wl_callback *callback,
+ force_frame = false;
+ }
+
+- if (!input->pointer)
++ if (!input->pointer || !input->pointer_surface)
+ return;
+
+ if (input_set_pointer_special(input))
+--
+2.35.1
+
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch
new file mode 100644
index 000000000..19eadcf7f
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch
@@ -0,0 +1,60 @@
+From cfde02d47a503cbfd0629bbfe0cb776686af8a91 Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Tue, 9 Apr 2024 18:34:22 +0300
+Subject: [PATCH] libweston: Add paint node destruction into
+ weston_layer_entry_remove()
+
+This prevents a potential crash where users of
+weston_layer_entry_insert/layer_entry_remove() would see when moving
+views into a NULL layer (effectively unmapping the surface/view).
+
+Users that have migrated to the weston_view_move_to_layer() are immune
+to this issue because that takes care paint node destruction.
+
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ libweston/compositor.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/libweston/compositor.c b/libweston/compositor.c
+index bb29b83b5..ea257bb90 100644
+--- a/libweston/compositor.c
++++ b/libweston/compositor.c
+@@ -3980,17 +3980,10 @@ weston_view_move_to_layer(struct weston_view *view,
+ struct weston_layer_entry *layer)
+ {
+ bool was_mapped = view->is_mapped;
+- struct weston_paint_node *pnode, *pntmp;
+
+ if (layer == &view->layer_link)
+ return;
+
+- /* Remove all paint nodes because we have no idea what a layer change
+- * does to view visibility on any output.
+- */
+- wl_list_for_each_safe(pnode, pntmp, &view->paint_node_list, view_link)
+- weston_paint_node_destroy(pnode);
+-
+ view->surface->compositor->view_list_needs_rebuild = true;
+
+ /* Damage the view's old region, and remove it from the layer. */
+@@ -4020,6 +4013,16 @@ weston_view_move_to_layer(struct weston_view *view,
+ WL_EXPORT void
+ weston_layer_entry_remove(struct weston_layer_entry *entry)
+ {
++ struct weston_paint_node *pnode, *pntmp;
++ struct weston_view *view;
++
++ /* Remove all paint nodes because we have no idea what a layer change
++ * does to view visibility on any output.
++ */
++ view = container_of(entry, struct weston_view, layer_link);
++ wl_list_for_each_safe(pnode, pntmp, &view->paint_node_list, view_link)
++ weston_paint_node_destroy(pnode);
++
+ wl_list_remove(&entry->link);
+ wl_list_init(&entry->link);
+ entry->layer = NULL;
+--
+2.43.0
+
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Migrate-weston_seat_init-release-to-public.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Migrate-weston_seat_init-release-to-public.patch
deleted file mode 100644
index 02af7cbaf..000000000
--- a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Migrate-weston_seat_init-release-to-public.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 4534fcab54409b08faf4445ed6780136b58afb63 Mon Sep 17 00:00:00 2001
-From: Marius Vlad <marius.vlad@collabora.com>
-Date: Mon, 28 Sep 2020 22:51:00 +0300
-Subject: [PATCH 1/2] libweston: Migrate weston_seat_init/release to public
- headers
-
-weston_seat_init/release needed for creating weston plug-ins that want
-manage seat/input on their own.
-
-Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
----
- include/libweston/libweston.h | 25 +++++++++++++++++++++++++
- libweston/libweston-internal.h | 31 +++----------------------------
- 2 files changed, 28 insertions(+), 28 deletions(-)
-
-diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
-index 54ea008..59541f2 100644
---- a/include/libweston/libweston.h
-+++ b/include/libweston/libweston.h
-@@ -2053,6 +2053,31 @@ void
- weston_timeline_refresh_subscription_objects(struct weston_compositor *wc,
- void *object);
-
-+/* input, seat */
-+void
-+weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
-+ const char *seat_name);
-+void
-+weston_seat_release(struct weston_seat *seat);
-+
-+void
-+weston_seat_init_pointer(struct weston_seat *seat);
-+
-+int
-+weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
-+
-+void
-+weston_seat_init_touch(struct weston_seat *seat);
-+
-+void
-+weston_seat_release_keyboard(struct weston_seat *seat);
-+
-+void
-+weston_seat_release_pointer(struct weston_seat *seat);
-+
-+void
-+weston_seat_release_touch(struct weston_seat *seat);
-+
- #ifdef __cplusplus
- }
- #endif
-diff --git a/libweston/libweston-internal.h b/libweston/libweston-internal.h
-index 66c38e8..f5c4c2c 100644
---- a/libweston/libweston-internal.h
-+++ b/libweston/libweston-internal.h
-@@ -168,44 +168,19 @@ weston_plane_init(struct weston_plane *plane,
- void
- weston_plane_release(struct weston_plane *plane);
-
--/* weston_seat */
--
- struct clipboard *
- clipboard_create(struct weston_seat *seat);
-
--void
--weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
-- const char *seat_name);
--
--void
--weston_seat_repick(struct weston_seat *seat);
-+/* weston_seat */
-
- void
--weston_seat_release(struct weston_seat *seat);
-+weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
-
- void
- weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client);
-
- void
--weston_seat_init_pointer(struct weston_seat *seat);
--
--int
--weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
--
--void
--weston_seat_init_touch(struct weston_seat *seat);
--
--void
--weston_seat_release_keyboard(struct weston_seat *seat);
--
--void
--weston_seat_release_pointer(struct weston_seat *seat);
--
--void
--weston_seat_release_touch(struct weston_seat *seat);
--
--void
--weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
-+weston_seat_repick(struct weston_seat *seat);
-
- void
- wl_data_device_set_keyboard_focus(struct weston_seat *seat);
---
-2.28.0
-
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-add-weston_layer_fini.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-add-weston_layer_fini.patch
deleted file mode 100644
index 5b4fd04c4..000000000
--- a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-add-weston_layer_fini.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 8740037a93c7c4400cc381ecf3009d1e4014be07 Mon Sep 17 00:00:00 2001
-From: Pekka Paalanen <pekka.paalanen@collabora.com>
-Upstream-Status: Backport
-Date: Fri, 14 May 2021 14:29:40 +0300
-Subject: [PATCH] libweston: add weston_layer_fini()
-
-Layers did not have a fini sequence before, which means the compositor
-layer list might have stale pointers temporarily when shutting down. A
-bigger problem might be having views linger after the destruction of the
-layer.
-
-These problems were not observed yet, but if they exist, this patch
-should help to find them and then fix them.
-
-The check in weston_compositor_shutdown() is not an assert yet, because
-it will trigger until all components call weston_layer_fini() correctly.
-Some components do not even have a tear-down function to call it from at
-all, like fullscreen-shell.
-
-The same with the check in weston_layer_fini().
-
-Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
----
- include/libweston/libweston.h | 2 ++
- libweston/compositor.c | 21 +++++++++++++++++++++
- 2 files changed, 23 insertions(+)
-
-diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
-index 7e8e7a625..d9907de0d 100644
---- a/include/libweston/libweston.h
-+++ b/include/libweston/libweston.h
-@@ -1637,6 +1637,8 @@ void
- weston_layer_init(struct weston_layer *layer,
- struct weston_compositor *compositor);
- void
-+weston_layer_fini(struct weston_layer *layer);
-+void
- weston_layer_set_position(struct weston_layer *layer,
- enum weston_layer_position position);
- void
-diff --git a/libweston/compositor.c b/libweston/compositor.c
-index dc6ecb2ce..c2da3a48c 100644
---- a/libweston/compositor.c
-+++ b/libweston/compositor.c
-@@ -3243,6 +3243,21 @@ weston_layer_init(struct weston_layer *layer,
- weston_layer_set_mask_infinite(layer);
- }
-
-+/** Finalize the weston_layer struct.
-+ *
-+ * \param layer The layer to finalize.
-+ */
-+WL_EXPORT void
-+weston_layer_fini(struct weston_layer *layer)
-+{
-+ wl_list_remove(&layer->link);
-+
-+ if (!wl_list_empty(&layer->view_list.link))
-+ weston_log("BUG: finalizing a layer with views still on it.\n");
-+
-+ wl_list_remove(&layer->view_list.link);
-+}
-+
- /** Sets the position of the layer in the layer list. The layer will be placed
- * below any layer with the same position value, if any.
- * This function is safe to call if the layer is already on the list, but the
-@@ -7738,6 +7753,12 @@ weston_compositor_shutdown(struct weston_compositor *ec)
- weston_binding_list_destroy_all(&ec->debug_binding_list);
-
- weston_plane_release(&ec->primary_plane);
-+
-+ weston_layer_fini(&ec->fade_layer);
-+ weston_layer_fini(&ec->cursor_layer);
-+
-+ if (!wl_list_empty(&ec->layer_list))
-+ weston_log("BUG: layer_list is not empty after shutdown. Calls to weston_layer_fini() are missing somwhere.\n");
- }
-
- /** weston_compositor_exit_with_code
---
-GitLab
-
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-desktop-rename-weston_desktop_client_destr.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-desktop-rename-weston_desktop_client_destr.patch
deleted file mode 100644
index 5332a89b0..000000000
--- a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-desktop-rename-weston_desktop_client_destr.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 5a6604a7a2e52e5cd84c1f53724b3f7c325b5dff Mon Sep 17 00:00:00 2001
-From: Pekka Paalanen <pekka.paalanen@collabora.com>
-Upstream-Status: Backport
-Date: Fri, 14 May 2021 15:54:56 +0300
-Subject: [PATCH] libweston-desktop: rename weston_desktop_client_destroy()
-
-This function here is a wl_resource destructor, but we will need another
-function for externally triggered destroy when wl_resource does not
-exist.
-
-Rename the existing function, because the old name fits better the new
-function to be written.
-
-Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
----
- libweston-desktop/client.c | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/libweston-desktop/client.c b/libweston-desktop/client.c
-index 56413f713..ba7bfbc46 100644
---- a/libweston-desktop/client.c
-+++ b/libweston-desktop/client.c
-@@ -49,7 +49,7 @@ weston_desktop_client_add_destroy_listener(struct weston_desktop_client *client,
- }
-
- static void
--weston_desktop_client_destroy(struct wl_resource *resource)
-+weston_desktop_client_handle_destroy(struct wl_resource *resource)
- {
- struct weston_desktop_client *client =
- wl_resource_get_user_data(resource);
-@@ -117,13 +117,12 @@ weston_desktop_client_create(struct weston_desktop *desktop,
-
- if (dispatcher != NULL)
- wl_resource_set_dispatcher(client->resource, dispatcher,
-- weston_desktop_client_destroy, client,
-- weston_desktop_client_destroy);
-+ weston_desktop_client_handle_destroy, client,
-+ weston_desktop_client_handle_destroy);
- else
- wl_resource_set_implementation(client->resource, implementation,
- client,
-- weston_desktop_client_destroy);
--
-+ weston_desktop_client_handle_destroy);
-
- display = wl_client_get_display(client->client);
- loop = wl_display_get_event_loop(display);
---
-GitLab
-
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0002-libweston-desktop-introduce-weston_desktop_client_de.patch b/meta-agl-core/recipes-graphics/wayland/weston/0002-libweston-desktop-introduce-weston_desktop_client_de.patch
deleted file mode 100644
index 229c8506a..000000000
--- a/meta-agl-core/recipes-graphics/wayland/weston/0002-libweston-desktop-introduce-weston_desktop_client_de.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From f53c05d3c2c19c139c52e9bd621c2654dd3dac69 Mon Sep 17 00:00:00 2001
-From: Pekka Paalanen <pekka.paalanen@collabora.com>
-Upstream-Status: Backport
-Date: Fri, 14 May 2021 16:04:45 +0300
-Subject: [PATCH] libweston-desktop: introduce weston_desktop_client_destroy()
-
-This new function is callable explicitly, unlike the old function that
-used to have the same name.
-
-This will be needed when tearing down what
-weston_desktop_xwayland_init() puts up.
-
-Since calling weston_desktop_client_destroy() for an external client
-(one that has a wl_resource for this) is a bug, add asserts to prevent
-it. This will only be needed for the internal client: XWM.
-
-Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
----
- libweston-desktop/client.c | 21 +++++++++++++++++----
- libweston-desktop/internal.h | 2 ++
- 2 files changed, 19 insertions(+), 4 deletions(-)
-
-diff --git a/libweston-desktop/client.c b/libweston-desktop/client.c
-index ba7bfbc46..44718e2db 100644
---- a/libweston-desktop/client.c
-+++ b/libweston-desktop/client.c
-@@ -24,6 +24,7 @@
- #include "config.h"
-
- #include <wayland-server.h>
-+#include <assert.h>
-
- #include <libweston/libweston.h>
- #include <libweston/zalloc.h>
-@@ -48,14 +49,14 @@ weston_desktop_client_add_destroy_listener(struct weston_desktop_client *client,
- wl_signal_add(&client->destroy_signal, listener);
- }
-
--static void
--weston_desktop_client_handle_destroy(struct wl_resource *resource)
-+void
-+weston_desktop_client_destroy(struct weston_desktop_client *client)
- {
-- struct weston_desktop_client *client =
-- wl_resource_get_user_data(resource);
- struct wl_list *list = &client->surface_list;
- struct wl_list *link, *tmp;
-
-+ assert(client->resource == NULL);
-+
- wl_signal_emit(&client->destroy_signal, client);
-
- for (link = list->next, tmp = link->next;
-@@ -71,6 +72,18 @@ weston_desktop_client_handle_destroy(struct wl_resource *resource)
- free(client);
- }
-
-+static void
-+weston_desktop_client_handle_destroy(struct wl_resource *resource)
-+{
-+ struct weston_desktop_client *client =
-+ wl_resource_get_user_data(resource);
-+
-+ assert(client->resource == resource);
-+ client->resource = NULL;
-+
-+ weston_desktop_client_destroy(client);
-+}
-+
- static int
- weston_desktop_client_ping_timeout(void *user_data)
- {
-diff --git a/libweston-desktop/internal.h b/libweston-desktop/internal.h
-index e4ab2701b..7a815bd87 100644
---- a/libweston-desktop/internal.h
-+++ b/libweston-desktop/internal.h
-@@ -134,6 +134,8 @@ weston_desktop_client_create(struct weston_desktop *desktop,
- const struct wl_interface *interface,
- const void *implementation, uint32_t version,
- uint32_t id);
-+void
-+weston_desktop_client_destroy(struct weston_desktop_client *client);
-
- void
- weston_desktop_client_add_destroy_listener(struct weston_desktop_client *client,
---
-GitLab
-
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0003-libweston-desktop-add-weston_desktop_xwayland_fini.patch b/meta-agl-core/recipes-graphics/wayland/weston/0003-libweston-desktop-add-weston_desktop_xwayland_fini.patch
deleted file mode 100644
index 1bcf5c7b4..000000000
--- a/meta-agl-core/recipes-graphics/wayland/weston/0003-libweston-desktop-add-weston_desktop_xwayland_fini.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From e2583ca0844bd7a8ce4fc94da9ad67edf49ffd45 Mon Sep 17 00:00:00 2001
-From: Pekka Paalanen <pekka.paalanen@collabora.com>
-Upstream-Status: Backport
-Date: Fri, 14 May 2021 16:12:35 +0300
-Subject: [PATCH] libweston-desktop: add weston_desktop_xwayland_fini()
-
-This fixes the following leaks detected by ASan in
-./tests/test-alpha-blending:
-
-Direct leak of 176 byte(s) in 2 object(s) allocated from:
- #0 0x7fb447880518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
- #1 0x7fb4432c12d7 in zalloc ../../git/weston/include/libweston/zalloc.h:38
- #2 0x7fb4432c2ca6 in weston_desktop_xwayland_init ../../git/weston/libweston-desktop/xwayland.c:410
- #3 0x7fb4432baadf in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:87
- #4 0x7fb4432e1e1f in wet_shell_init ../../git/weston/tests/weston-test-desktop-shell.c:224
- #5 0x7fb44775fddd in wet_load_shell ../../git/weston/compositor/main.c:956
- #6 0x7fb447770db1 in wet_main ../../git/weston/compositor/main.c:3434
- #7 0x56172c599279 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432
- #8 0x56172c59cce5 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528
- #9 0x56172c58dc8c in fixture_setup ../../git/weston/tests/alpha-blending-test.c:65
- #10 0x56172c58dd31 in fixture_setup_run_ ../../git/weston/tests/alpha-blending-test.c:67
- #11 0x56172c59d29a in main ../../git/weston/tests/weston-test-runner.c:661
- #12 0x7fb4473d509a in __libc_start_main ../csu/libc-start.c:308
-
-Indirect leak of 144 byte(s) in 2 object(s) allocated from:
- #0 0x7fb447880518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
- #1 0x7fb4432bb592 in zalloc ../../git/weston/include/libweston/zalloc.h:38
- #2 0x7fb4432bb882 in weston_desktop_client_create ../../git/weston/libweston-desktop/client.c:108
- #3 0x7fb4432c2d0e in weston_desktop_xwayland_init ../../git/weston/libweston-desktop/xwayland.c:415
- #4 0x7fb4432baadf in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:87
- #5 0x7fb4432e1e1f in wet_shell_init ../../git/weston/tests/weston-test-desktop-shell.c:224
- #6 0x7fb44775fddd in wet_load_shell ../../git/weston/compositor/main.c:956
- #7 0x7fb447770db1 in wet_main ../../git/weston/compositor/main.c:3434
- #8 0x56172c599279 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432
- #9 0x56172c59cce5 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528
- #10 0x56172c58dc8c in fixture_setup ../../git/weston/tests/alpha-blending-test.c:65
- #11 0x56172c58dd31 in fixture_setup_run_ ../../git/weston/tests/alpha-blending-test.c:67
- #12 0x56172c59d29a in main ../../git/weston/tests/weston-test-runner.c:661
- #13 0x7fb4473d509a in __libc_start_main ../csu/libc-start.c:308
-
-Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
----
- libweston-desktop/internal.h | 2 ++
- libweston-desktop/libweston-desktop.c | 2 ++
- libweston-desktop/xwayland.c | 16 ++++++++++++++++
- 3 files changed, 20 insertions(+)
-
-diff --git a/libweston-desktop/internal.h b/libweston-desktop/internal.h
-index 7a815bd87..2606d279b 100644
---- a/libweston-desktop/internal.h
-+++ b/libweston-desktop/internal.h
-@@ -240,5 +240,7 @@ weston_desktop_wl_shell_create(struct weston_desktop *desktop,
-
- void
- weston_desktop_xwayland_init(struct weston_desktop *desktop);
-+void
-+weston_desktop_xwayland_fini(struct weston_desktop *desktop);
-
- #endif /* WESTON_DESKTOP_INTERNAL_H */
-diff --git a/libweston-desktop/libweston-desktop.c b/libweston-desktop/libweston-desktop.c
-index c1efd2012..2b42ac7e3 100644
---- a/libweston-desktop/libweston-desktop.c
-+++ b/libweston-desktop/libweston-desktop.c
-@@ -95,6 +95,8 @@ weston_desktop_destroy(struct weston_desktop *desktop)
- if (desktop == NULL)
- return;
-
-+ weston_desktop_xwayland_fini(desktop);
-+
- if (desktop->wl_shell != NULL)
- wl_global_destroy(desktop->wl_shell);
- if (desktop->xdg_shell_v6 != NULL)
-diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
-index 711c8a30c..c1c5fc4a7 100644
---- a/libweston-desktop/xwayland.c
-+++ b/libweston-desktop/xwayland.c
-@@ -423,3 +423,19 @@ weston_desktop_xwayland_init(struct weston_desktop *desktop)
- compositor->xwayland = xwayland;
- compositor->xwayland_interface = &weston_desktop_xwayland_interface;
- }
-+
-+void
-+weston_desktop_xwayland_fini(struct weston_desktop *desktop)
-+{
-+ struct weston_compositor *compositor = weston_desktop_get_compositor(desktop);
-+ struct weston_desktop_xwayland *xwayland;
-+
-+ xwayland = compositor->xwayland;
-+
-+ weston_desktop_client_destroy(xwayland->client);
-+ weston_layer_fini(&xwayland->layer);
-+ free(xwayland);
-+
-+ compositor->xwayland = NULL;
-+ compositor->xwayland_interface = NULL;
-+}
---
-GitLab
-