feat(wlr/taskbar): add homogeneous option to evenly distribute button widths
#4543
+19
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an optional
homogeneousboolean to thewlr/taskbarmodule that evenly distributes the width of all task buttons across the module's available space. When enabled, each task button expands to take an equal share of the enclosing Gtk box (e.g., with a 1000px center box: 1 task = 1000px, 2 tasks = 500px each, 3 tasks ≈ 333px each, etc.).Configuration
It is off by default and enabling requires:
If the used bar supports it, also ensure the center container can grow:
Behavior Details
"expand": true), you won't see full-width distribution.Screenshots
Before: different sized buttons by default.

After: with


"homogeneous": true,"expand": true,"expand-center": trueand"fixed-center": false(visuals depend on theme and spacing).Docs
homogeneouskey to thewlr/taskbarmodule documentation with accepted values and defaults.Testing
"expand-center": true).Future
Very long window titles will let the bar grow beyond its configured
widthin the configuration file. It is the same as before. This will be addressed in a separate PR to ensure ellipsization/clipping to truncate text and fit the box size.Motivation
Users who keep many windows open want their taskbar buttons to automatically resize to fit the module width, avoiding overflow and uneven spacing. GTK provides native support for homogeneous children; this PR exposes that via a config flag for the taskbar.