git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit9d32e4826beaccae91e3573bd173d2dc1b2242ec
parentb10ec8c528
authorIsaac Freund <[email protected]>
date2026-02-12 15:10
Cursor: fix handling of pointer bindings during op

Currently if a pointer binding is triggered during an op we set
Cursor.mode to ignore, resulting in op_release never being sent.

 river/Cursor.zig | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/river/Cursor.zig b/river/Cursor.zig
index 9bc21c6..8e542b1 100644
--- a/river/Cursor.zig
+++ b/river/Cursor.zig
@@ -418,9 +418,16 @@ pub fn processButton(cursor: *Cursor, event: *const wlr.Pointer.event.Button) vo
         if (cursor.seat.matchPointerBinding(event.button)) |binding| {
             result.value_ptr.* = binding;
             binding.pressed();
-            log.debug("entering cursor mode ignore", .{});
-            cursor.mode = .ignore;
-            cursor.clearFocus();
+            switch (cursor.mode) {
+                .passthrough, .drag, .down => {
+                    log.debug("entering cursor mode ignore", .{});
+                    cursor.mode = .ignore;
+                    cursor.clearFocus();
+                },
+                // It is important that we do not enter ignore mode if an op is in progress,
+                // doing so would result in op_release never being sent for example.
+                .op, .ignore => {},
+            }
             return;
         }