git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit2aa0f2dbd1c8403675ea3ad3a02f70654d777d2d
parentb99938747d
authorLucas Galante <[email protected]>
date2026-08-05 14:49
fix: sync status box_geom from the live commit, like self-sizing overlays

Client-initiated expand/contract commits land in the dead spot the
Idle-arm comment documents: geometry is already refreshed, so nothing
updated box_geom until a later render pass. box_geom drives the
expanded-state order hash (b999387), so the freshly opened menu still
spent a beat stacked under its sibling segments before the restack.
Mirror the overlay live-geometry sync for status segments (without
set_dimensions — the WM leaves status sizes to the client) so the
restack lands with the expanding commit.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/server/xdg_toplevel.rs | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/server/xdg_toplevel.rs b/src/server/xdg_toplevel.rs
index a2a3540..0737f9f 100644
--- a/src/server/xdg_toplevel.rs
+++ b/src/server/xdg_toplevel.rs
@@ -655,6 +655,27 @@ unsafe extern "C" fn handle_commit(listener: *mut ffi::wl_listener, _data: *mut
         }
     }
 
+    // Status segments self-size the same way when an in-surface menu grows or
+    // contracts the surface (no configure round trip). Track the live
+    // geometry in the same commit: box_geom feeds the expanded-state order
+    // hash that restacks the segment into the popups layer, so a lagging
+    // box_geom left the freshly opened menu stacked UNDER its sibling
+    // segments (their text drew sharp over the menu's blur) for a beat.
+    // Unlike the overlay branch, no set_dimensions — the WM deliberately
+    // leaves status segment sizes to the client.
+    if is_status {
+        let mut live = std::mem::zeroed();
+        ffi::river_wlr_xdg_surface_get_geometry(base, &mut live);
+        if live.width > 0 && live.height > 0
+            && (live.width != (*window).box_geom.width || live.height != (*window).box_geom.height)
+        {
+            (*window).box_geom.width = live.width;
+            (*window).box_geom.height = live.height;
+            (*window).self_resized = true;
+            (*(*window).server).wm.dirty_windowing();
+        }
+    }
+
     match (*toplevel).configure_state {
         ConfigureState::Idle | ConfigureState::Committed | ConfigureState::TimedOut(..) => {
             // Nothing to do: client-initiated size/position changes CANNOT