1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
From: =?utf-8?q?Jonas_=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 11 Sep 2025 10:58:29 +0200
Subject: wayland/shell-surface: Assume geometry empty if no buffer attached
Don't include subsurfaces when deriving the actual window geometry if
the main surface isn't yet mapped, since subsurfaces are not mapped if
the parent surface isn't, which it can't be unless there is a buffer
attached.
Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/4310
Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4648
---
src/wayland/meta-wayland-shell-surface.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c
index 81cb2a8..2ae76f5 100644
--- a/src/wayland/meta-wayland-shell-surface.c
+++ b/src/wayland/meta-wayland-shell-surface.c
@@ -54,6 +54,12 @@ meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_su
MtkRectangle geometry;
MetaWaylandSurface *subsurface_surface;
+ if (!meta_wayland_surface_get_buffer (surface))
+ {
+ *out_geometry = (MtkRectangle) {};
+ return;
+ }
+
geometry = (MtkRectangle) {
.width = meta_wayland_surface_get_width (surface),
.height = meta_wayland_surface_get_height (surface),
|