Commit graph

1 commit

Author SHA1 Message Date
Robert Mader
609dc4baa3 xdg-shell: Gate all configure events behind first commit
The protocol requires clients to perform an initial commit before they
receive configure events:
> After creating a role-specific object and setting it up (e.g. by sending
> the title, app ID, size constraints, parent, etc), the client must
> perform an initial commit without any buffer attached. The compositor
> will reply with initial wl_surface state such as
> wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
> event. The client must acknowledge it and is then allowed to attach a
> buffer to map the surface.

Previous to this patch various calls such as set_fullscreen() or
set_maximized() would schedule configure events, resulting in clients
being able skip the initial commit. This again made it possible to write
clients that only work on Weston, in violation of the protocol.

For xdg-popups we already tracked the initial commit status. Move it
to xdg-surface, guard schedule_configure() on it and ensure to run the
later on the initial commit.

Incorporate tests that checks if we get configure events when calling
set_fullscreen/set_maximized and tests that uses the main xdg_surface as
a parent to a sub-surface (which initially triggered this issue).

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2026-01-06 12:21:29 +02:00