From e0246c04104fad95573f07c3bfc4547c7ce1d116 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 19 Apr 2022 11:10:53 +0200 Subject: [PATCH] Cursor: Don't passthrough() on update if hidden Currently when the surface under the hidden cursor changes, we passthrough() which results in the cursor being made visible and giving pointer focus to the surface under the cursor if any. Obviously this is not desirable as the cursor is supposed to remain hidden until moved. This added check prevents this. --- river/Cursor.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/river/Cursor.zig b/river/Cursor.zig index 04c0ee3..da1b8d6 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -927,6 +927,10 @@ pub fn updateState(self: *Self) void { } fn shouldPassthrough(self: Self) bool { + // We clear focus on hiding the cursor and should not re-focus until the cursor is moved + // and shown again. + if (self.hidden) return false; + switch (self.mode) { .passthrough => { // If we are not currently in down/resize/move mode, we *always* need to passthrough()