aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-07-24 02:30:15 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-07-24 02:30:15 +0200
commitf371e00716898d2330c22d2f17d9785e918f115e (patch)
treef314362e65f5b525609ae78f11229887d8108d77
parent53dd3875b325e9936ddd4ed13be66ea5d304d3c5 (diff)
downloadriver-f371e00716898d2330c22d2f17d9785e918f115e.tar.gz
river-f371e00716898d2330c22d2f17d9785e918f115e.tar.xz
cursor: fix logic in Cursor.updateState()
The previous commit re-introduced a bug fixed by a3c65713 which caused the pointer enter event not to be sent until moving the pointer when switching tag focus or otherwise manipulating the window manager caused the cursor to end up over a new surface.
-rw-r--r--river/Cursor.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/river/Cursor.zig b/river/Cursor.zig
index bb94e7a..06fd452 100644
--- a/river/Cursor.zig
+++ b/river/Cursor.zig
@@ -775,7 +775,7 @@ fn processMotion(self: *Self, device: *wlr.InputDevice, time: u32, delta_x: f64,
/// the target view of a cursor operation potentially being moved to a non-visible tag,
/// becoming fullscreen, etc.
pub fn updateState(self: *Self) void {
- if (self.shouldExitMode()) {
+ if (self.shouldPassthrough()) {
self.mode = .passthrough;
var now: os.timespec = undefined;
os.clock_gettime(os.CLOCK_MONOTONIC, &now) catch @panic("CLOCK_MONOTONIC not supported");
@@ -785,9 +785,14 @@ pub fn updateState(self: *Self) void {
}
}
-fn shouldExitMode(self: Self) bool {
+fn shouldPassthrough(self: Self) bool {
switch (self.mode) {
- .passthrough => return false,
+ .passthrough => {
+ // If we are not currently in down/resize/move mode, we *always* need to passthrough()
+ // as what is under the cursor may have changed and we are not locked to a single
+ // target view.
+ return true;
+ },
.down => |target| {
// The target view is no longer visible
return target.current.tags & target.output.current.tags == 0;