aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2022-01-29 15:40:29 +0100
committerGitHub <noreply@github.com>2022-01-29 15:40:29 +0100
commit214ad65b726b3915baeede5506b1c2bfda7f7f01 (patch)
tree355840718bde273c3827585c131e50bbbe0a77db
parent363efd3e7949c9aafc947fda9a58571eee543ab6 (diff)
downloadriver-214ad65b726b3915baeede5506b1c2bfda7f7f01.tar.gz
river-214ad65b726b3915baeede5506b1c2bfda7f7f01.tar.xz
Cursor: update image if needed on xcursor theme change
-rw-r--r--river/Cursor.zig7
1 files changed, 6 insertions, 1 deletions
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);
+ }
}
}