event_loop: honour App::window_size_hint() on the first configure
Previously only `set_min_size()` was called with the requested size, on the assumption that the compositor would adopt it as the initial dimension. In practice that doesn't hold: xdg-shell has no "preferred initial size" primitive and compositors are free to pick any size within `[min, max]` on the first configure. The window ended up opening at the 800x600 fallback instead of the size the application had asked for. The fix pins `min == max` before the first commit, which forces the compositor to honour the requested size in its first configure, and then releases `max_size` from the configure handler via the `pending_size_hint_unpin` latch so the surface remains user-resizable afterwards. The 800x600 fallback now only applies when the application does not provide a hint.
This commit is contained in:
@@ -675,6 +675,9 @@ pub struct AppData<A: App>
|
||||
pub exit_requested: bool,
|
||||
/// First-configure latch for `App::start_fullscreen`.
|
||||
pub pending_fullscreen: bool,
|
||||
/// First-configure latch: clears `max_size` after the compositor
|
||||
/// has honoured the pinned initial size.
|
||||
pub pending_size_hint_unpin: bool,
|
||||
/// Main application surface.
|
||||
pub main: SurfaceState<A::Message>,
|
||||
/// Auxiliary layer-shell surfaces keyed by their stable [`OverlayId`].
|
||||
|
||||
Reference in New Issue
Block a user