aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--river/InputManager.zig5
-rw-r--r--river/Root.zig6
-rw-r--r--river/XdgToplevel.zig1
3 files changed, 7 insertions, 5 deletions
diff --git a/river/InputManager.zig b/river/InputManager.zig
index dd066c4..886d86c 100644
--- a/river/InputManager.zig
+++ b/river/InputManager.zig
@@ -178,6 +178,11 @@ pub fn inputAllowed(self: Self, wlr_surface: *wlr.Surface) bool {
true;
}
+pub fn maybeResetCursorState(self: Self) void {
+ var it = self.seats.first;
+ while (it) |node| : (it = node.next) node.data.cursor.maybeResetState();
+}
+
fn handleInhibitActivate(
listener: *wl.Listener(*wlr.InputInhibitManager),
input_inhibit_manager: *wlr.InputInhibitManager,
diff --git a/river/Root.zig b/river/Root.zig
index b51abed..4384159 100644
--- a/river/Root.zig
+++ b/river/Root.zig
@@ -405,11 +405,7 @@ fn commitTransaction(self: *Self) void {
output.damage.addWhole();
}
-
- var seat_it = server.input_manager.seats.first;
- while (seat_it) |seat_node| : (seat_it = seat_node.next) {
- seat_node.data.cursor.maybeResetState();
- }
+ server.input_manager.maybeResetCursorState();
}
/// Send the new output configuration to all wlr-output-manager clients
diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig
index 7431e05..f3cda8c 100644
--- a/river/XdgToplevel.zig
+++ b/river/XdgToplevel.zig
@@ -273,6 +273,7 @@ fn handleCommit(listener: *wl.Listener(*wlr.Surface), surface: *wlr.Surface) voi
view.current = view.pending;
if (self_tags_changed) view.output.sendViewTags();
view.output.damage.addWhole();
+ server.input_manager.maybeResetCursorState();
}
} else {
// If the client has not yet acked our configure, we need to send a