mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-10 22:15:37 +00:00
Accidentally reverted 172865ff13
This commit is contained in:
parent
6cbdc66650
commit
99e85cc27b
|
@ -130,6 +130,7 @@ struct hid_device_list_node
|
|||
|
||||
static IOHIDManagerRef hid_mgr = 0x0;
|
||||
static struct hid_device_list_node *device_list = 0x0;
|
||||
static int hid_input_monitoring_denied = 0;
|
||||
|
||||
static hid_device *new_hid_device(void)
|
||||
{
|
||||
|
@ -522,6 +523,10 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
|
|||
if (hid_init() < 0)
|
||||
return NULL;
|
||||
|
||||
/* If we don't have permission to open devices, don't enumerate them */
|
||||
if (hid_input_monitoring_denied)
|
||||
return NULL;
|
||||
|
||||
/* give the IOHIDManager a chance to update itself */
|
||||
process_pending_events();
|
||||
|
||||
|
@ -862,6 +867,11 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive)
|
|||
|
||||
return dev;
|
||||
}
|
||||
else if (ret == kIOReturnNotPermitted) {
|
||||
/* This application doesn't have input monitoring permissions */
|
||||
hid_input_monitoring_denied = 1;
|
||||
goto return_error;
|
||||
}
|
||||
else {
|
||||
goto return_error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue