diff --git a/river/Root.zig b/river/Root.zig index 6d2dd8f..b20e1cf 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -718,7 +718,10 @@ fn commitTransaction(root: *Root) void { { var it = server.input_manager.seats.first; - while (it) |node| : (it = node.next) node.data.cursor.updateState(); + while (it) |node| : (it = node.next) { + node.data.cursor.updateState(); + node.data.sendFocusedView(); + } } { diff --git a/river/Seat.zig b/river/Seat.zig index 6fc7c65..6ac9c4d 100644 --- a/river/Seat.zig +++ b/river/Seat.zig @@ -220,6 +220,11 @@ pub fn focus(seat: *Seat, _target: ?*View) void { } } +pub fn sendFocusedView(seat: *Seat) void { + var it = seat.status_trackers.first; + while (it) |node| : (it = node.next) node.data.sendFocusedView(); +} + /// Switch focus to the target, handling unfocus and input inhibition /// properly. This should only be called directly if dealing with layers or /// override redirect xwayland views. @@ -288,8 +293,7 @@ pub fn setFocusRaw(seat: *Seat, new_focus: FocusTarget) void { seat.cursor.may_need_warp = true; // Inform any clients tracking status of the change - var it = seat.status_trackers.first; - while (it) |node| : (it = node.next) node.data.sendFocusedView(); + seat.sendFocusedView(); } /// Send keyboard enter/leave events and handle pointer constraints