remove borders in tabbed and monocle

This commit is contained in:
2026-08-01 15:08:12 +02:00
parent f5a0b6136f
commit 7d117f4ae5
2 changed files with 25 additions and 7 deletions
+22 -6
View File
@@ -809,9 +809,21 @@ const tiled_all: river.WindowV1.Edges = .{
.bottom = true,
};
fn applyWindowState(self: *Wm) void {
const bw = config.border_width;
/// How wide a border to give a window.
///
/// The stacking layouts show one window filling the whole area, so a border
/// there frames the screen rather than separating anything from anything:
/// monocle and tabbed get none, and a fullscreen window never had one.
/// Floating windows keep theirs whatever the layout, since those really do
/// overlap.
fn borderWidth(win: *const Window) i32 {
if (win.fullscreen) return 0;
if (win.floating) return config.border_width;
const out = win.output orelse return config.border_width;
return if (out.stacked) 0 else config.border_width;
}
fn applyWindowState(self: *Wm) void {
for (self.windows.items) |win| {
if (win.closed) continue;
@@ -855,7 +867,7 @@ fn applyWindowState(self: *Wm) void {
if (!win.visible) continue;
const content = win.cell.inset(bw);
const content = win.cell.inset(borderWidth(win));
const w, const h = win.clampSize(content.width, content.height);
if (w != win.proposed_width or h != win.proposed_height) {
win.window.proposeDimensions(w, h);
@@ -872,7 +884,6 @@ fn applyWindowState(self: *Wm) void {
fn render(self: *Wm) void {
const gpa = self.gpa;
const bw = config.border_width;
self.scratch_order.clearRetainingCapacity();
@@ -886,7 +897,7 @@ fn render(self: *Wm) void {
self.setHidden(win, !show);
if (!show) continue;
self.place(win, bw);
self.place(win, borderWidth(win));
self.scratch_order.append(gpa, win) catch {};
}
@@ -927,7 +938,7 @@ fn render(self: *Wm) void {
}
std.mem.sort(*Window, self.scratch_windows.items, {}, lessByFocus);
for (self.scratch_windows.items) |win| {
self.place(win, bw);
self.place(win, borderWidth(win));
self.scratch_order.append(gpa, win) catch {};
}
@@ -970,6 +981,11 @@ fn place(self: *Wm, win: *Window, bw: i32) void {
const content = win.cell.inset(bw);
if (win.getNode()) |node| node.setPosition(content.x, content.y);
if (bw == 0) {
win.window.setBorders(.{}, 0, 0, 0, 0, 0);
return;
}
const focused = self.isFocusedAnywhere(win);
const rgba = if (focused) config.border_focused else config.border_normal;
const ch = color.toChannels(rgba);