summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2023-04-17 18:35:09 +0200
committerMarge Bot <marge-bot@gnome.org>2023-04-18 10:37:18 +0000
commitdb24557e40013f9af548e2f1e49481285a03fb3d (patch)
tree756f610cfa21c88e03b1b2fa38b85d8af228bad7
parent867494d3df9f17a2cac1f102805ff348046abad6 (diff)
downloadmutter-db24557e40013f9af548e2f1e49481285a03fb3d.tar.gz
wayland/xdg-shell: Bail from popup_configure if resource was destroyed
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2967>
-rw-r--r--src/wayland/meta-wayland-xdg-shell.c3
1 files changed, 3 insertions, 0 deletions
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.