[PATCH 0/1] MR5039: winebus.sys: Do not attempt to open keyboard and mouse HID devices on macOS.
Doing so triggers a permissions prompt for input monitoring. Patch originally by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5039
From: Tim Clem <tclem(a)codeweavers.com> Doing so triggers a permissions prompt for input monitoring. Patch originally by Rémi Bernon. --- dlls/winebus.sys/bus_iohid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c index 7c8c3cc3529..fdcd820e99e 100644 --- a/dlls/winebus.sys/bus_iohid.c +++ b/dlls/winebus.sys/bus_iohid.c @@ -276,6 +276,16 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void * }; struct iohid_device *impl; CFStringRef str; + UINT usage_page, usage; + + usage_page = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDPrimaryUsagePageKey))); + usage = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDPrimaryUsageKey))); + + if (usage_page == HID_USAGE_PAGE_GENERIC && (usage == HID_USAGE_GENERIC_MOUSE || usage == HID_USAGE_GENERIC_KEYBOARD)) + { + TRACE("Ignoring mouse / keyboard device\n"); + return; + } desc.vid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVendorIDKey))); desc.pid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDProductIDKey))); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5039
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5039
participants (3)
-
Rémi Bernon -
Tim Clem -
Tim Clem (@tclem)