From a2571be53e05079af041759ca9e3337b43299224 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 28 Mar 2026 09:33:22 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2066=20=E2=80=94=20XDG=20popup?= =?UTF-8?q?=20initial=20configure=20for=20context=20menus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle WLR_XDG_SURFACE_ROLE_POPUP surfaces in handle_xdg_new_surface by scheduling the initial configure event. XDG popups (context menus, autocomplete dropdowns, tooltips) need a compositor configure before they can commit their first buffer; without it they stall indefinitely. Popups are not managed by the policy layer — they are self-contained transient surfaces positioned relative to their parent by the positioner. We schedule configure and log the event without creating a wl_toplevel_view. Co-Authored-By: Claude Sonnet 4.6 --- src/backend/wayland/wl_backend.c | 15 ++++++++++++++- tests/wl-smoke-test.sh | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 604e1f5..12060ba 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -57,6 +57,9 @@ * Phase 65: prop_get_transient_for implemented — walks xdg_toplevel->parent * chain and returns the synthetic WNativeWindow ID of the parent view so * dialog windows are correctly identified as transients by the policy layer. + * Phase 66: XDG popup initial configure — schedule configure for + * WLR_XDG_SURFACE_ROLE_POPUP so context menus and autocomplete dropdowns + * can commit their first buffer without stalling on the compositor. */ #ifdef HAVE_CONFIG_H @@ -355,8 +358,18 @@ handle_xdg_new_surface(struct wl_listener *listener, void *data) struct wl_toplevel_view *view; (void)listener; + if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { + /* Phase 66: schedule the initial configure for XDG popups so clients + * that use popups (context menus, autocomplete, tooltips) can commit + * their first buffer without stalling. We do not manage popups in + * the policy layer — they are self-contained transient surfaces. */ + wlr_xdg_surface_schedule_configure(xdg_surface); + wwarning("wl_backend: new XDG popup (scheduled configure)"); + return; + } + if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) - return; /* ignore popups for now */ + return; view = wmalloc(sizeof(*view)); memset(view, 0, sizeof(*view)); diff --git a/tests/wl-smoke-test.sh b/tests/wl-smoke-test.sh index 986568e..ca81d56 100755 --- a/tests/wl-smoke-test.sh +++ b/tests/wl-smoke-test.sh @@ -52,6 +52,9 @@ # CLIENT_SIDE mode ("decoration mode=client_side" logged). # 23. (Phase 65) prop_get_transient_for returns parent XDG surface ID for # dialog windows (build-only check — weston-simple-shm has no transients). +# 24. (Phase 66) XDG popup initial configure scheduled so context menus and +# autocomplete dropdowns can commit first buffer without stalling +# (build-only check — weston-simple-shm creates no popups). # # This test grows as wl_backend vtable slots are implemented. #