Fix focused view sometimes being reported as having no tags

This commit is contained in:
2025-10-09 16:05:23 -07:00
parent 936d1157b4
commit 82613a56db

View File

@ -81,8 +81,12 @@ pub fn sendFocusedView(seat_status: SeatStatus) void {
if (seat_status.seat_status_v1.getVersion() >= 4) { if (seat_status.seat_status_v1.getVersion() >= 4) {
switch (seat_status.seat.focused) { switch (seat_status.seat.focused) {
.view => |view| { .view => |view| {
//assert(view.inflight.tags == view.current.tags); if (view.current.tags != 0) {
seat_status.seat_status_v1.sendFocusedView(view.getTitle() orelse "", view.current.tags); // A view can't be on no tags, so we need to wait for the
// layout to update. There is probably a better way to do
// this, but this way seems to work.
seat_status.seat_status_v1.sendFocusedView(view.getTitle() orelse "", view.current.tags);
}
}, },
else => seat_status.seat_status_v1.sendFocusedView("", 0), else => seat_status.seat_status_v1.sendFocusedView("", 0),
} }