From 03431acf4ab64b150ace0834a2da383a2ca51636 Mon Sep 17 00:00:00 2001 From: Ali Chraghi Date: Wed, 28 Dec 2022 20:47:44 +0330 Subject: [PATCH] glfw: accept null cursor in Window.setCursor --- libs/glfw/src/Window.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/glfw/src/Window.zig b/libs/glfw/src/Window.zig index 6bfdd6a5..1810e9bb 100644 --- a/libs/glfw/src/Window.zig +++ b/libs/glfw/src/Window.zig @@ -2059,9 +2059,9 @@ pub inline fn setCursorPos(self: Window, xpos: f64, ypos: f64) error{PlatformErr /// @thread_safety This function must only be called from the main thread. /// /// see also: cursor_object -pub inline fn setCursor(self: Window, cursor: Cursor) error{PlatformError}!void { +pub inline fn setCursor(self: Window, cursor: ?Cursor) error{PlatformError}!void { internal_debug.assertInitialized(); - c.glfwSetCursor(self.handle, cursor.ptr); + c.glfwSetCursor(self.handle, if (cursor) |cs| cs.ptr else null); getError() catch |err| return switch (err) { Error.NotInitialized => unreachable, Error.PlatformError => |e| e,