]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: omit pointer cursor shape for tablet tool
authorJens Peters <jp7677@gmail.com>
Sun, 8 Jun 2025 09:38:25 +0000 (11:38 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 13 Jun 2025 18:24:20 +0000 (19:24 +0100)
Omit cursor notifications from a pointer when a tablet
tool (stylus/pen) is in proximity. This is equivalent
to `handle_request_set_cursor()` and prevents a resize
cursor for out-of-surface scrolling with a tablet tool in
recent GTK4 (which uses the cursor shape protocol).

src/input/cursor.c

index d97b93aba990977fa5a2114472fc830771367c9f..217f6be231967a5b2fe4c9d5b23b94ab3f87249f 100644 (file)
@@ -224,6 +224,16 @@ handle_request_set_shape(struct wl_listener *listener, void *data)
                return;
        }
 
+       /*
+        * Omit cursor notifications from a pointer when a tablet
+        * tool (stylus/pen) is in proximity.
+        */
+       if (tablet_tool_has_focused_surface(seat)
+                       && event->device_type
+                               != WLR_CURSOR_SHAPE_MANAGER_V1_DEVICE_TYPE_TABLET_TOOL) {
+               return;
+       }
+
        wlr_log(WLR_DEBUG, "set xcursor to shape %s", shape_name);
        wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager, shape_name);
 }