fix: use roundtrip instead of blocking dispatch for initial events

This commit is contained in:
drendog 2025-12-28 22:33:51 +01:00
parent 91455060c7
commit 7a80655bfc
Signed by: dwenya
GPG key ID: 8DD77074645332D0

View file

@ -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 })?;