show names on tabs in tabbed layout
This commit is contained in:
@@ -137,6 +137,15 @@ pub fn applyRules(self: *Window) void {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether this window currently has a tab drawn for it, i.e. it is tiled and
|
||||
/// visible on an output that is showing the tabbed layout.
|
||||
fn onTabBar(self: *Window) bool {
|
||||
if (config.tabbar_height <= 0) return false;
|
||||
if (!self.visible or self.floating or self.fullscreen or self.closed) return false;
|
||||
const out = self.output orelse return false;
|
||||
return out.state().layout == .tabbed;
|
||||
}
|
||||
|
||||
fn setString(self: *Window, field: *?[]u8, value: ?[*:0]const u8) void {
|
||||
const gpa = self.wm.gpa;
|
||||
if (field.*) |old| gpa.free(old);
|
||||
@@ -190,6 +199,10 @@ fn onEvent(_: *river.WindowV1, event: river.WindowV1.Event, self: *Window) void
|
||||
self.setString(&self.title, ev.title);
|
||||
self.applyRules();
|
||||
self.wm.ipcDirty();
|
||||
// The tab bar has this title painted into it, so a window that is
|
||||
// wearing a tab needs the strip redrawn. Terminals retitle
|
||||
// themselves constantly, so ask only when it will show.
|
||||
if (self.onTabBar()) self.wm.needsManage();
|
||||
},
|
||||
|
||||
.identifier => |ev| {
|
||||
|
||||
Reference in New Issue
Block a user