https://bugs.winehq.org/show_bug.cgi?id=50153
Bug ID: 50153 Summary: HID doesn't work on macOS Catalina and Big Sur unless "Input Monitoring" permission is granted Product: Wine Version: 5.22 Hardware: x86-64 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: hid Assignee: wine-bugs@winehq.org Reporter: bshanks@codeweavers.com
On macOS Catalina and Big Sur, if the user-level app (usually Terminal) doesn't have permission granted for "Input Monitoring" in System Preferences -> Security & Privacy, the IOHID support in winebus will fail with 'Couldn't open IOHIDManager.'. And when Wine is quitting and the driver unloads, it tries to call the IOHIDManager that was already released, causing a crash.
IOHIDManagerOpen() is failing with kIOReturnNotPermitted because it actually tries to "open" every matching device, which is every HID device on the system, including the keyboard (which requires Input Monitoring permission). (Yes, this API design is very confusing, and poorly documented).
Better is to open individual devices instead, so even if the keyboard fails to open other devices will still work.
Also it would be ideal to not "open" a device until it's necessary, so there won't be a permission prompt unless a Windows app actually wants to read from the keyboard. Currently some part of Wine's HID stack requests input reports when the device gets enumerated, triggering the permission prompt.
https://bugs.winehq.org/show_bug.cgi?id=50153
--- Comment #1 from Gijs Vermeulen gijsvrm@gmail.com --- Was this fixed by https://source.winehq.org/git/wine.git/commit/9c0c0e2b57e0a5e27a1e0a8d1d2ca4660a0e4a86?
https://bugs.winehq.org/show_bug.cgi?id=50153
Brendan Shanks bshanks@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |9c0c0e2b57e0a5e27a1e0a8d1d2 | |ca4660a0e4a86
--- Comment #2 from Brendan Shanks bshanks@codeweavers.com --- Yes I think we can call this fixed. I'd still like to improve this further (not opening devices until necessary), but the big problem has been fixed.
https://bugs.winehq.org/show_bug.cgi?id=50153
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.0-rc6.
https://bugs.winehq.org/show_bug.cgi?id=50153
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |5.0.x
https://bugs.winehq.org/show_bug.cgi?id=50153
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|5.0.x |---
--- Comment #4 from Michael Stefaniuc mstefani@winehq.org --- Removing the 5.0.x milestone from bug fixes included in 5.0.4.