wayland: Phase 66 — XDG popup initial configure for context menus

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 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-03-28 09:33:22 +01:00
parent 9bdf3c058b
commit a2571be53e
2 changed files with 17 additions and 1 deletions

View File

@ -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));

View File

@ -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.
#