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:
parent
87ec2d4f60
commit
b8d31de3ef
6 changed files with 160 additions and 106 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue