river-status: only send mode event if client bound version 3
This commit is contained in:
parent
d657dc791b
commit
2df2151afa
@ -363,8 +363,7 @@ pub fn enterMode(self: *Self, mode_id: u32) void {
|
|||||||
|
|
||||||
var it = self.status_trackers.first;
|
var it = self.status_trackers.first;
|
||||||
while (it) |node| : (it = node.next) {
|
while (it) |node| : (it = node.next) {
|
||||||
const seat_status = node.data.seat_status;
|
node.data.sendMode(server.config.modes.items[mode_id].name);
|
||||||
seat_status.sendMode(server.config.modes.items[mode_id].name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ pub fn init(self: *Self, seat: *Seat, seat_status: *zriver.SeatStatusV1) void {
|
|||||||
seat_status.setHandler(*Self, handleRequest, handleDestroy, self);
|
seat_status.setHandler(*Self, handleRequest, handleDestroy, self);
|
||||||
|
|
||||||
// Send all info once on bind
|
// Send all info once on bind
|
||||||
seat_status.sendMode(server.config.modes.items[seat.mode_id].name);
|
self.sendMode(server.config.modes.items[seat.mode_id].name);
|
||||||
self.sendOutput(.focused);
|
self.sendOutput(.focused);
|
||||||
self.sendFocusedView();
|
self.sendFocusedView();
|
||||||
}
|
}
|
||||||
@ -72,3 +72,9 @@ pub fn sendFocusedView(self: Self) void {
|
|||||||
"";
|
"";
|
||||||
self.seat_status.sendFocusedView(title);
|
self.seat_status.sendFocusedView(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn sendMode(self: Self, mode: [*:0]const u8) void {
|
||||||
|
if (self.seat_status.getVersion() >= 3) {
|
||||||
|
self.seat_status.sendMode(mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user