Add window title and wm info to Bar

This commit adds the focused window title to the left side of the bar
and some WM info (primary count/ratio and # of visible/total windows) to
the right side.

It also adds new vertical_padding and horizontal_padding config options
for the bar.
This commit is contained in:
Ben Buhse 2026-02-27 10:42:08 -06:00
commit efd0222899
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
9 changed files with 231 additions and 51 deletions

View file

@ -137,9 +137,15 @@ pub fn manage(seat: *Seat) void {
switch (pending_window) {
.window => |window| {
if (seat.focused_window) |focused| {
// Tell the previously focused Window that it's no longer focused
if (focused != window) {
// Tell the previously focused Window that it's no longer focused
focused.pending_render.focused = false;
// Update the Bar to have the newly-focused window's title
if (focused.output) |output| {
if (output.bar) |*bar| {
bar.pending_render.draw = true;
}
}
}
}
seat.focused_window = window;