aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-12-29 10:32:21 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-02-25 08:22:20 +0000
commit7f26914583a0114e102e4596763302a5bc6d1730 (patch)
tree375d8913b31dad955ae7efd2ee56a79c19941359 /wayland.c
parentdoc: foot.ini: fix spelling mistake in [bell].urgent description (diff)
wayland: ignore configure events for unmapped surfaces
Closes #1249 Note that it is still unclear whether ack:ing a configure event for an unmapped surface is a protocol violation, or something that should be handled by the compositor. According to https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/108, Kwin, Mutter and Weston handles it, while wlroots does not.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/wayland.c b/wayland.c
index 55d45da7..68a7a4f1 100644
--- a/wayland.c
+++ b/wayland.c
@@ -769,6 +769,16 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
struct wl_window *win = data;
struct terminal *term = win->term;
+ if (win->unmapped) {
+ /*
+ * https://codeberg.org/dnkl/foot/issues/1249
+ * https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3487
+ * https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3719
+ * https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/108
+ */
+ return;
+ }
+
bool wasnt_configured = !win->is_configured;
bool was_resizing = win->is_resizing;
bool csd_was_enabled = win->csd_mode == CSD_YES && !win->is_fullscreen;
@@ -1619,6 +1629,7 @@ wayl_win_destroy(struct wl_window *win)
wayl_roundtrip(win->term->wl);
/* Main window */
+ win->unmapped = true;
wl_surface_attach(win->surface, NULL, 0, 0);
wl_surface_commit(win->surface);
wayl_roundtrip(win->term->wl);