From db24557e40013f9af548e2f1e49481285a03fb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 17 Apr 2023 18:35:09 +0200 Subject: [PATCH] wayland/xdg-shell: Bail from popup_configure if resource was destroyed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function gets called when a surface state transaction is applied. Applying a transaction can get delayed, so the Wayland resource may have already been destroyed when we get here. In that case we cannot send events, so there's nothing to do. v2: * Drop code comment, expand commit log instead. (Jonas Ã…dahl) Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2737 Part-of: --- src/wayland/meta-wayland-xdg-shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index b0ce310d2..682024a2a 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -1364,6 +1364,9 @@ meta_wayland_xdg_popup_configure (MetaWaylandShellSurface *shell_surface, int geometry_scale; int x, y; + if (!xdg_popup->resource) + return; + /* If the parent surface was destroyed, its window will be destroyed * before the popup receives the parent-destroy signal. This means that * the popup may potentially get temporary focus until itself is destroyed.