From f7f842d42b6addd603f62360fa88d79ffb5c4255 Mon Sep 17 00:00:00 2001 From: Raphael Amorim Date: Fri, 17 Apr 2026 01:11:23 +0200 Subject: [PATCH] fix wayland freeze (closes #1461 #1081) --- .../platform_impl/linux/wayland/event_loop/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rio-window/src/platform_impl/linux/wayland/event_loop/mod.rs b/rio-window/src/platform_impl/linux/wayland/event_loop/mod.rs index 54103619..fd498942 100644 --- a/rio-window/src/platform_impl/linux/wayland/event_loop/mod.rs +++ b/rio-window/src/platform_impl/linux/wayland/event_loop/mod.rs @@ -505,12 +505,18 @@ impl EventLoop { return None; } + // Reset the frame-callback state so the window can accept a new + // callback when the app commits (pre_present_notify). + // + // NOTE: don't call request_frame_callback here. It would call + // wl_suface::frame() before we know wether a render will happen. + // If this iteration emits no RedraRequested, the app never commits, + // callback stay pending forever and the next itration sees + // state == Requested and short-cirtuits above. + // Freezing the loop until external events happen to work around it. let was_received = window.frame_callback_state() == FrameCallbackState::Received; window.frame_callback_reset(); - if was_received { - window.request_frame_callback(); - } let mut redraw_requested = window_requests .get(window_id) -- 2.51.2