aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2022-04-19 11:10:53 +0200
committerIsaac Freund <mail@isaacfreund.com>2022-04-19 11:10:53 +0200
commite0246c04104fad95573f07c3bfc4547c7ce1d116 (patch)
tree85f88b7d089a4ab3a00f7c703b00b2adc89187a5
parenta8491eb13e18ed7d9f69229ac0930a0255834d35 (diff)
downloadriver-e0246c04104fad95573f07c3bfc4547c7ce1d116.tar.gz
river-e0246c04104fad95573f07c3bfc4547c7ce1d116.tar.xz
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.
-rw-r--r--river/Cursor.zig4
1 files changed, 4 insertions, 0 deletions
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()