diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2024-01-04 19:03:37 +0200 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2024-01-04 14:13:55 -0600 |
| commit | 9f0e0f2c0a4c24ebdd54982b824a382b1836c165 (patch) | |
| tree | d53d9a40d844cc8739dabb90d094e67fa588f971 | |
| parent | c86f460135bc3f04502561c2e6631b690859d426 (diff) | |
| download | river-9f0e0f2c0a4c24ebdd54982b824a382b1836c165.tar.gz river-9f0e0f2c0a4c24ebdd54982b824a382b1836c165.tar.xz | |
Cursor: actually set xcursor_name
| -rw-r--r-- | river/Cursor.zig | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/river/Cursor.zig b/river/Cursor.zig index b288ee2..99a0e3b 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -276,12 +276,17 @@ pub fn setTheme(self: *Self, theme: ?[*:0]const u8, _size: ?u32) !void { } if (self.xcursor_name) |name| { - self.wlr_cursor.setXcursor(self.xcursor_manager, name); + self.setXcursor(name); } } +pub fn setXcursor(self: *Self, name: [*:0]const u8) void { + self.wlr_cursor.setXcursor(self.xcursor_manager, name); + self.xcursor_name = name; +} + fn clearFocus(self: *Self) void { - self.wlr_cursor.setXcursor(self.xcursor_manager, "left_ptr"); + self.setXcursor("left_ptr"); self.seat.wlr_seat.pointerNotifyClearFocus(); } @@ -775,7 +780,7 @@ fn enterMode(cursor: *Self, mode: Mode, view: *View, xcursor_name: [*:0]const u8 } cursor.seat.wlr_seat.pointerNotifyClearFocus(); - cursor.wlr_cursor.setXcursor(cursor.xcursor_manager, xcursor_name); + cursor.setXcursor(xcursor_name); server.root.applyPending(); } |
