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

commit1cd8cee1f225e773dcd283bab1c09c6b087fe6c9
parent12da3b7096
authorIsaac Freund <[email protected]>
date2025-12-22 16:13
protocol: add river_seat_v1.set_xcursor_theme

 protocol/river-window-management-v1.xml | 10 ++++++++++
 river/Seat.zig                          | 10 ++++++++++
 river/WindowManager.zig                 |  2 +-
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/protocol/river-window-management-v1.xml b/protocol/river-window-management-v1.xml
index e5761d3..cdec753 100644
--- a/protocol/river-window-management-v1.xml
+++ b/protocol/river-window-management-v1.xml
@@ -1493,6 +1493,16 @@
       <arg name="button" type="uint" summary="a Linux input event code"/>
       <arg name="modifiers" type="uint" enum="modifiers"/>
     </request>
+
+    <request name="set_xcursor_theme" since="2">
+      <description summary="set the xcursor theme for the seat">
+        Set the XCursor theme for the seat. This theme is used for cursors
+        rendered by the compositor, but not necessarily for cursors rendered by
+        clients.
+      </description>
+      <arg name="name" type="string"/>
+      <arg name="size" type="uint"/>
+    </request>
   </interface>
 
   <interface name="river_pointer_binding_v1" version="2">
diff --git a/river/Seat.zig b/river/Seat.zig
index 8257f42..0fe675e 100644
--- a/river/Seat.zig
+++ b/river/Seat.zig
@@ -488,6 +488,16 @@ fn handleRequest(
                 return;
             };
         },
+
+        .set_xcursor_theme => |args| {
+            seat.cursor.setTheme(args.name, args.size) catch |err| switch (err) {
+                error.OutOfMemory => {
+                    seat_v1.getClient().postNoMemory();
+                    log.err("out of memory", .{});
+                    return;
+                },
+            };
+        },
     }
 }
 
diff --git a/river/WindowManager.zig b/river/WindowManager.zig
index a009f4e..92da31b 100644
--- a/river/WindowManager.zig
+++ b/river/WindowManager.zig
@@ -92,7 +92,7 @@ pub fn init(wm: *WindowManager) !void {
     errdefer timeout.remove();
 
     wm.* = .{
-        .global = try wl.Global.create(server.wl_server, river.WindowManagerV1, 1, *WindowManager, wm, bind),
+        .global = try wl.Global.create(server.wl_server, river.WindowManagerV1, 2, *WindowManager, wm, bind),
         .sent = .{
             .outputs = undefined,
             .seats = undefined,