Start adding tags

Right now, essentially nothing has changed, there is still no multi-
output support and not even a way to change/set/toggle/view/etc. tags.

However, tags *are* implemented at a core level. Next step is to add
keybinds for the various tag actions.

After that, I will work on multi-output support.
This commit is contained in:
Ben Buhse 2026-01-26 15:04:41 -06:00
commit b8d31de3ef
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
6 changed files with 160 additions and 106 deletions

View file

@ -13,10 +13,17 @@ height: i32 = 0,
x: i32 = 0,
y: i32 = 0,
/// Tags are 32-bit bitfield. A window can be active on one(?) or more tags.
tags: u32 = 0x0001,
pending_manage: PendingManage = .{},
link: wl.list.Link,
pub const PendingManage = struct {
tags: ?u32 = null,
};
pub fn create(context: *Context, river_output_v1: *river.OutputV1) !*Output {
var output = try utils.allocator.create(Output);
errdefer output.destroy();
@ -49,7 +56,8 @@ fn outputListener(river_output_v1: *river.OutputV1, event: river.OutputV1.Event,
output.height = ev.height;
},
.position => |ev| {
// TODO - CONFIG: Allow setting output position (do I even need to do this?)
// TODO - CONFIG: Allow setting output position (do I even need to
// do this, or do I just get told what the position is?)
output.x = ev.x;
output.y = ev.y;
},
@ -57,7 +65,11 @@ fn outputListener(river_output_v1: *river.OutputV1, event: river.OutputV1.Event,
}
pub fn manage(output: *Output) void {
_ = output;
defer output.pending_manage = .{};
if (output.pending_manage.tags) |tags| {
output.tags = tags;
}
}
pub fn render(output: *Output) void {