From 7a80655bfc3208c3fec7d71b2b57fdfd890a9933 Mon Sep 17 00:00:00 2001 From: drendog Date: Sun, 28 Dec 2025 22:33:51 +0100 Subject: [PATCH] fix: use roundtrip instead of blocking dispatch for initial events --- crates/adapters/src/wayland/shell_adapter.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/adapters/src/wayland/shell_adapter.rs b/crates/adapters/src/wayland/shell_adapter.rs index eab5d80..969994a 100644 --- a/crates/adapters/src/wayland/shell_adapter.rs +++ b/crates/adapters/src/wayland/shell_adapter.rs @@ -610,7 +610,12 @@ impl WaylandShellSystem { info!("Starting WindowingSystem main loop"); info!("Processing initial Wayland configuration events"); - while self.event_queue.blocking_dispatch(&mut self.state)? > 0 { + // first roundtrip to receive initial output, globals, and surface configure events + // second roundtrip handles any cascading configure events like fractional scaling and layer surface configures + for i in 0..2 { + let dispatched = self.event_queue.roundtrip(&mut self.state)?; + info!("Roundtrip {} dispatched {} events", i + 1, dispatched); + self.connection .flush() .map_err(|e| LayerShikaError::WaylandProtocol { source: e })?;