[Development] Wayland: getting a screen's fractional scale before the first window exists

David Edmundson davidedmundson at kde.org
Tue Aug 25 15:17:01 CEST 2026


>I am not sure if the protocol guarantees when
>`wl_surface::preferred_buffer_scale` is sent (or
>`wp_fractional_scale_v1::preferred_scale` in fractional scale case)

They will always come before the xdg_shelll.configure event.

It is documented in xdg_surface top level comment

```
 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.
``` (https://wayland.app/protocols/xdg-shell#xdg_surface)

In Qt client terms, the QExposeEvent is driven by the first
xdg_shelll.configure event arriving.

There is no need for additional round trips. Technically speaking a
roundtrip is also not a guarantee that the event will have been
delivered.

David


More information about the Development mailing list