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

commitf13d9019ea0faa59f26c52b487d1f3747e71478e
parentf467de6d96
authorIsaac Freund <[email protected]>
date2022-01-05 18:13
Cursor: remove minor outdated workaround

Since Zig 0.9 @tagName() and other similar builtins return 0 terminated
data.

 river/Cursor.zig | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/river/Cursor.zig b/river/Cursor.zig
index 2e53202..19b9762 100644
--- a/river/Cursor.zig
+++ b/river/Cursor.zig
@@ -233,11 +233,7 @@ fn setImage(self: *Self, image: Image) void {
 
     if (image == self.image) return;
     self.image = image;
-
-    // TODO: this is a workaround until updating to zig 0.9.0
-    const image_z = util.gpa.dupeZ(u8, @tagName(image)) catch return;
-    defer util.gpa.free(image_z);
-    self.xcursor_manager.setCursorImage(image_z, self.wlr_cursor);
+    self.xcursor_manager.setCursorImage(@tagName(image), self.wlr_cursor);
 }
 
 fn clearFocus(self: *Self) void {