]> git.mdlowis.com Git - proto/labwc.git/commitdiff
input/cursor.c: avoid consuming scroll on client mousebind
authorelviosak <33790211+elviosak@users.noreply.github.com>
Fri, 24 Oct 2025 20:26:18 +0000 (17:26 -0300)
committerGitHub <noreply@github.com>
Fri, 24 Oct 2025 20:26:18 +0000 (22:26 +0200)
src/input/cursor.c

index f3ae9f311832cb5e5f5815ef3bfb8dc6821bf8c0..fe694db4e81e719df1a66a4f83705cd8c24073f3 100644 (file)
@@ -1346,7 +1346,7 @@ process_cursor_axis(struct server *server, enum wl_pointer_axis orientation,
                wlr_log(WLR_DEBUG, "Failed to handle cursor axis event");
        }
 
-       bool handled = false;
+       bool consumed = false;
        if (direction != LAB_DIRECTION_INVALID) {
                struct mousebind *mousebind;
                wl_list_for_each(mousebind, &rc.mousebinds, link) {
@@ -1358,7 +1358,8 @@ process_cursor_axis(struct server *server, enum wl_pointer_axis orientation,
                                        && mousebind->direction == direction
                                        && modifiers == mousebind->modifiers
                                        && mousebind->mouse_event == MOUSE_ACTION_SCROLL) {
-                               handled = true;
+                               consumed |= mousebind->context == LAB_NODE_FRAME;
+                               consumed |= mousebind->context == LAB_NODE_ALL;
                                /*
                                 * Action may not be executed if the accumulated scroll delta
                                 * on touchpads or hi-res mice doesn't exceed the threshold
@@ -1371,7 +1372,7 @@ process_cursor_axis(struct server *server, enum wl_pointer_axis orientation,
        }
 
        /* Bindings swallow mouse events if activated */
-       if (ctx.surface && !handled) {
+       if (ctx.surface && !consumed) {
                /* Make sure we are sending the events to the surface under the cursor */
                double sx, sy;
                cursor_update_common(server, &ctx, /*cursor_has_moved*/ false, &sx, &sy);