Skip to content

wayland: xdg_surface configuration improvements - #18280

Open
mahkoh wants to merge 2 commits into
mpv-player:masterfrom
mahkoh:jorth/xdg-surface-configure
Open

wayland: xdg_surface configuration improvements#18280
mahkoh wants to merge 2 commits into
mpv-player:masterfrom
mahkoh:jorth/xdg-surface-configure

Conversation

@mahkoh

@mahkoh mahkoh commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

wayland: trigger redraw after every configure sequence

After a configure sequence, the compositor waits for the client to
commit. This is necessary to synchronize changes. For example:

  1. Window is focused.
  2. Window loses focus.
  3. Compositor sends configuration sequence.
  4. Client acks and commits.
  5. Compositor redraws the window decorations as unfocused.

Without the synchronization with the configuration sequence, the window
contents might show an "unfocused" state while the decorations show a
"focused" state and vice versa.

mpv does not change its look when focused/unfocused but the compositor
cannot know this and many applications do this.

It would be sufficient to wl_surface_commit instead of ORing
VO_EVENT_EXPOSE, but this seems to be the safer way and configuration
sequences are rare.


wayland: defer config sequence application

xdg_surface.configure can occur with a delay after
xdg_toplevel.configure and there can be more than one
xdg_toplevel.configure events between xdg_surface.configure events.

As per xdg_toplevel.configure:

The configured state should not be applied immediately. See
xdg_surface.configure for details.

After a configure sequence, the compositor waits for the client to
commit. This is necessary to synchronize changes. For example:

1. Window is focused.
2. Window loses focus.
3. Compositor sends configuration sequence.
4. Client acks and commits.
5. Compositor redraws the window decorations as unfocused.

Without the synchronization with the configuration sequence, the window
contents might show an "unfocused" state while the decorations show a
"focused" state and vice versa.

mpv does not change its look when focused/unfocused but the compositor
cannot know this and many applications do this.

It would be sufficient to wl_surface_commit instead of ORing
VO_EVENT_EXPOSE, but this seems to be the safer way and configuration
sequences are rare.
Copilot AI review requested due to automatic review settings July 22, 2026 13:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mahkoh
mahkoh force-pushed the jorth/xdg-surface-configure branch from 09a0839 to d1aa21b Compare July 22, 2026 13:36
xdg_surface.configure can occur with a delay after
xdg_toplevel.configure and there can be more than one
xdg_toplevel.configure events between xdg_surface.configure events.

As per xdg_toplevel.configure:

> The configured state should not be applied immediately. See
> xdg_surface.configure for details.
@mahkoh
mahkoh force-pushed the jorth/xdg-surface-configure branch from d1aa21b to a630518 Compare July 22, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants