weston/libweston/desktop
Leandro Ribeiro 446f36b0cd xdg-shell: ensure that client resource is not NULL before use
Functions that implement the xdg_surface, toplevel and popup
interfaces may depend on struct weston_desktop_client::resource.

In normal circumstances, this resource can't be NULL. The xdg protocol
extension forbids destroying xdg_wm_base before destroying all its child
surfaces. If that happens, we disconnect the client with protocol error
DEFUNCT_SURFACES (see commit "xdg-shell: handle xdg_wm_base being
destroyed before its children").

But during client teardown resources are destroyed in arbitrary order,
so it is possible that client resource becomes NULL before its surfaces
are destroyed.

This commit adds checks to avoid using NULL client resource, in order to
avoid crashes. It is safe to silently do nothing in these cases, as the
client is being destroyed anyway.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-02-23 09:15:31 +00:00
..
client.c libweston/desktop: Update my Copyright 2024-02-11 19:07:39 +01:00
internal.h libweston-desktop: Break grabs when a parent surface is destroyed 2024-05-21 13:21:35 -05:00
libweston-desktop.c Revert "shared/helpers.h: Migrate helpers.h to libweston" 2025-01-17 10:18:26 +02:00
meson.build Move libweston-desktop into libweston 2022-06-28 10:35:52 +00:00
seat.c libweston-desktop: Break grabs when a parent surface is destroyed 2024-05-21 13:21:35 -05:00
surface.c xdg-shell: ensure that client resource is not NULL before use 2026-02-23 09:15:31 +00:00
xdg-shell-v6.c xdg-shell: ensure that client resource is not NULL before use 2026-02-23 09:15:31 +00:00
xdg-shell.c xdg-shell: ensure that client resource is not NULL before use 2026-02-23 09:15:31 +00:00
xwayland.c libweston-desktop: replace surface %p with name 2026-02-19 16:21:19 +02:00