git.lucas.co / cce-status-interface
status bar
git clone https://git.lucas.co/cce-status-interface.git

commit726264ffbb09db9a1dd061c395b4b9a2164ee9e7
parent1214ac7de6
authorLucas Galante <[email protected]>
date2026-08-04 21:00
fix: quantize the window module's title-mode width to 24px steps

Title-mode sized the surface to the exact title text, so every title
change (dirty markers, browser tabs, terminal cwd) resized the surface
and shoved the neighboring module sideways — seen as the light_source
module flickering while a title flapped between 372px and 456px fast
enough to sustain the compositor's configure echo storm.

Width now rounds up to a 24px step: title changes within a bucket cost
nothing; bucket crossings still resize but are far rarer, and the
compositor-side absorb (cce-fx@02e905a) handles the echoes. The
viewport-tabs mode stays exact — tabs only change with the viewport set.

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

 src/modules.rs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/modules.rs b/src/modules.rs
index 0951cba..e36d10a 100644
--- a/src/modules.rs
+++ b/src/modules.rs
@@ -125,7 +125,15 @@ impl StatusModule for WindowModule {
                 total_w += layout_label.w;
             }
 
-            total_w + 2.0 * padding
+            // Title-mode width quantized UP to a coarse step: titles change
+            // constantly (dirty markers, browser tabs, terminal cwd), and
+            // sizing to the exact text resized this surface on every change —
+            // shoving the neighboring module sideways each time (the
+            // light_source flicker) and, at 372↔456px alternation rates,
+            // feeding the compositor's configure echo loop. Within a bucket a
+            // title change costs nothing.
+            const TITLE_WIDTH_STEP: f32 = 24.0;
+            ((total_w + 2.0 * padding) / TITLE_WIDTH_STEP).ceil() * TITLE_WIDTH_STEP
         } else {
             let viewport_parsed = parse_viewport_text(viewport);
             if viewport_parsed.is_empty() {