aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-07-27 14:45:38 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-07-28 13:44:23 +0200
commit9e70fb25a5894bbdf5831d7347c27dddb37c5170 (patch)
treed94c093f5dfaf97e39bf795f6cb51c9100a414c6
parent90008cfa53df4dab107a5b5d708d50e6f42758ce (diff)
downloadriver-9e70fb25a5894bbdf5831d7347c27dddb37c5170.tar.gz
river-9e70fb25a5894bbdf5831d7347c27dddb37c5170.tar.xz
output: fix debug log on tag change
-rw-r--r--river/OutputStatus.zig7
-rw-r--r--river/Root.zig7
2 files changed, 6 insertions, 8 deletions
diff --git a/river/OutputStatus.zig b/river/OutputStatus.zig
index cc6a041..e6e6045 100644
--- a/river/OutputStatus.zig
+++ b/river/OutputStatus.zig
@@ -40,7 +40,7 @@ pub fn init(self: *Self, output: *Output, output_status: *zriver.OutputStatusV1)
// Send view/focused tags once on bind.
self.sendViewTags();
- self.sendFocusedTags();
+ self.sendFocusedTags(output.current.tags);
}
fn handleRequest(output_status: *zriver.OutputStatusV1, request: zriver.OutputStatusV1.Request, self: *Self) void {
@@ -73,7 +73,6 @@ pub fn sendViewTags(self: Self) void {
self.output_status.sendViewTags(&wl_array);
}
-/// Send the currently focused tags of the output to the client.
-pub fn sendFocusedTags(self: Self) void {
- self.output_status.sendFocusedTags(self.output.current.tags);
+pub fn sendFocusedTags(self: Self, tags: u32) void {
+ self.output_status.sendFocusedTags(tags);
}
diff --git a/river/Root.zig b/river/Root.zig
index 79e1d49..94f6d0a 100644
--- a/river/Root.zig
+++ b/river/Root.zig
@@ -368,16 +368,15 @@ fn commitTransaction(self: *Self) void {
const output = &output_node.data;
// Apply pending state of the output
- const output_tags_changed = output.pending.tags != output.current.tags;
- output.current = output.pending;
- if (output_tags_changed) {
+ if (output.pending.tags != output.current.tags) {
std.log.scoped(.output).debug(
"changing current focus: {b:0>10} to {b:0>10}",
.{ output.current.tags, output.pending.tags },
);
var it = output.status_trackers.first;
- while (it) |node| : (it = node.next) node.data.sendFocusedTags();
+ while (it) |node| : (it = node.next) node.data.sendFocusedTags(output.pending.tags);
}
+ output.current = output.pending;
var view_tags_changed = false;