river-status: add mode event to seat status

This allows clients such as a status bar to display the currently active
mode.
This commit is contained in:
Isaac Freund
2022-05-31 18:09:03 +02:00
parent 03e8da669c
commit d657dc791b
10 changed files with 49 additions and 27 deletions

View File

@ -188,7 +188,7 @@ fn handleInhibitActivate(
// Enter locked mode
seat_node.data.prev_mode_id = seat_node.data.mode_id;
seat_node.data.mode_id = 1;
seat_node.data.enterMode(1);
}
self.exclusive_client = self.input_inhibit_manager.active_client;
@ -215,8 +215,9 @@ fn handleInhibitDeactivate(
// have each Seat handle focus and enter their previous mode.
var seat_it = self.seats.first;
while (seat_it) |seat_node| : (seat_it = seat_node.next) {
seat_node.data.focus(null);
seat_node.data.mode_id = seat_node.data.prev_mode_id;
const seat = &seat_node.data;
seat.enterMode(seat.prev_mode_id);
seat.focus(null);
}
server.root.startTransaction();