Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Don't set the raw mouse motion input mode on macOS #48

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const std = @import("std");
const testing = std.testing;
const mem = std.mem;
const c = @import("c.zig").c;
const builtin = @import("builtin");

const glfw = @import("main.zig");
const Image = @import("Image.zig");
Expand Down Expand Up @@ -1563,10 +1564,14 @@ pub const InputModeCursor = enum(c_int) {
pub inline fn setInputModeCursor(self: Window, value: InputModeCursor) void {
if (value == .disabled) {
self.setInputMode(.cursor, value);
return self.setInputMode(.raw_mouse_motion, true);
if(builtin.target.os.tag != .macos) { // Raw mouse motion is not supported on macOS
self.setInputMode(.raw_mouse_motion, true);
}
}
self.setInputMode(.cursor, value);
return self.setInputMode(.raw_mouse_motion, false);
if(builtin.target.os.tag != .macos) {
self.setInputMode(.raw_mouse_motion, false);
}
}

/// Gets the current input mode of the cursor.
Expand Down