From 92b090a44103865e3c07d8fe151138c4c8b13ead Mon Sep 17 00:00:00 2001 From: "Pedro M. de Echanove Pasquin" Date: Thu, 10 Sep 2026 22:57:30 +0200 Subject: [PATCH] App: fix the on_main_frame_committed doc, the hook orders a swap, it does not make it atomic The comment promised that a subsurface mounted or retired from the hook lands in the same flush as the main frame. It does not: the main buffer goes out with its swap, which flushes the connection at once, and the subsurfaces are reconciled afterwards. What the hook guarantees is ordering, the main frame is already sent when it fires, which is enough to retire a subsurface safely but not to mount one without a gap. --- src/app.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index 8bf7164..7b68e38 100644 --- a/src/app.rs +++ b/src/app.rs @@ -563,8 +563,9 @@ pub trait App: 'static /// Called every time a buffer for the main surface has been rendered and /// committed, before the subsurfaces are reconciled for the same - /// iteration. Lets a host retire or mount a subsurface in the same flush - /// as the main frame it replaces, so the swap lands in one frame. + /// iteration. Lets a host sequence a subsurface change after the main + /// frame it depends on: a subsurface retired here goes away only once + /// the main frame that replaces it has been sent. fn on_main_frame_committed( &mut self ) {} /// Called when the surface is asked to close (compositor request, titlebar button,