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.
This commit is contained in:
Isaac Freund 2022-04-19 11:10:53 +02:00
parent a8491eb13e
commit e0246c0410
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -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()