From 214ad65b726b3915baeede5506b1c2bfda7f7f01 Mon Sep 17 00:00:00 2001 From: Leon Henrik Plickat Date: Sat, 29 Jan 2022 15:40:29 +0100 Subject: Cursor: update image if needed on xcursor theme change --- river/Cursor.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/river/Cursor.zig b/river/Cursor.zig index 19b9762..acc19eb 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -188,7 +188,8 @@ pub fn setTheme(self: *Self, theme: ?[*:0]const u8, _size: ?u32) !void { } // If this cursor belongs to the default seat, set the xcursor environment - // variables and the xwayland cursor theme. + // variables as well as the xwayland cursor theme and update the cursor + // image if necessary. if (self.seat == server.input_manager.defaultSeat()) { const size_str = try std.fmt.allocPrintZ(util.gpa, "{}", .{size}); defer util.gpa.free(size_str); @@ -211,6 +212,10 @@ pub fn setTheme(self: *Self, theme: ?[*:0]const u8, _size: ?u32) !void { @intCast(i32, image.hotspot_y), ); } + + if (self.image != .unknown) { + self.xcursor_manager.setCursorImage(@tagName(self.image), self.wlr_cursor); + } } } -- cgit v1.2.3