Fix bug where windows don't have border on wm restart

Before, if you restarted the WM with windows already present, any
non-focused window would just not have a border (because borderes are
only drawn on focus change, which happens for all new windows, but not
exisiting ones). I guess this probably would've happened if users add
new windows appending and didn't focus on new window spawns? Anyways,
now we just tell new windows they're unfocused to draw the border on
first render.
This commit is contained in:
Ben Buhse 2026-02-27 12:07:24 -06:00
commit dfdea33389
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4

View file

@ -97,6 +97,9 @@ pub fn create(context: *Context, river_window_v1: *river.WindowV1, output: ?*Out
.output = output, .output = output,
.tags = if (output) |o| o.tags else 0x0001, .tags = if (output) |o| o.tags else 0x0001,
.link = undefined, // Handled by the wl.list .link = undefined, // Handled by the wl.list
// Ensure borders are applied on the first render cycle, even for windows that
// are never explicitly told they are unfocused (e.g. on WM restart).
.pending_render = .{ .focused = false },
}; };
window.river_window_v1.setListener(*Window, windowListener, window); window.river_window_v1.setListener(*Window, windowListener, window);