Implement wallpaper rendering with multi-output support

This actually renders a wallpaper for each output using the newly added
Buffer and BufferPool for shared-memory surfaces and creates a
wlr-layer-shell surface per output. Right now, each wallpaper
shares the same wallpaper (though scaled to each).

wl_output globals get added to a HashMap that is used by Output when it
gets an output event.

Fix null-safety in WindowManager when no seats/outputs exist and route
Window dimensions through pending_manage.
This commit is contained in:
Ben Buhse 2026-02-07 17:27:24 -06:00
commit e186a2d017
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
9 changed files with 568 additions and 35 deletions

View file

@ -35,8 +35,7 @@ pending_manage: PendingManage = .{},
/// State consumed in render() phase, reset at end of render().
pending_render: PendingRender = .{},
/// Used to put Windows into a list in
/// WindowManager.calculatePrimaryStackLayout()
/// Used to put Windows into a list in calculatePrimaryStackLayout()
active_list_node: DoublyLinkedList.Node = .{},
link: wl.list.Link,
@ -141,10 +140,10 @@ fn windowListener(river_window_v1: *river.WindowV1, event: river.WindowV1.Event,
window.destroy();
},
.dimensions => |ev| {
// The protocol requires these are strictly greater than zero.
// Protocol guarantees that width and height are strictly greater than zero
assert(ev.width > 0 and ev.height > 0);
window.width = @intCast(ev.width);
window.height = @intCast(ev.height);
window.pending_manage.width = @intCast(ev.width);
window.pending_manage.height = @intCast(ev.height);
},
.dimensions_hint => {
// TODO: Maybe could use this for floating windows