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

commit8e098a4498804bcaaaea1661369f4c7fe9944eeb
parentd45b1b2d14
authorLeon Henrik Plickat <[email protected]>
date2024-03-15 15:10
TabletTool: use "pencil" cursor shape

This makes tablet tool cursors visually distinct from pointer cursors by
default. Client may of course continue to set custom cursors for tablet
tools if they have focus.

Also fixes a custom cursor set by a client persisting after the tablet
exits the client's surface until proximity out.

 river/TabletTool.zig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/river/TabletTool.zig b/river/TabletTool.zig
index b0f4ff4..7693875 100644
--- a/river/TabletTool.zig
+++ b/river/TabletTool.zig
@@ -186,7 +186,7 @@ pub fn proximity(tool: *TabletTool, tablet: *Tablet, event: *wlr.Tablet.event.Pr
 
             tool.wlr_cursor.warpAbsolute(tablet.device.wlr_device, event.x, event.y);
 
-            tool.wlr_cursor.setXcursor(tablet.device.seat.cursor.xcursor_manager, "default");
+            tool.wlr_cursor.setXcursor(tablet.device.seat.cursor.xcursor_manager, "pencil");
 
             tool.passthrough(tablet);
         },
@@ -259,6 +259,8 @@ fn passthrough(tool: *TabletTool, tablet: *Tablet) void {
             tool.wp_tool.notifyMotion(result.sx, result.sy);
             return;
         }
+    } else {
+        tool.wlr_cursor.setXcursor(tablet.device.seat.cursor.xcursor_manager, "pencil");
     }
 
     tool.wp_tool.notifyProximityOut();