mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-19 09:48:14 +00:00
Use a separate sensor watching function for gamepad events to avoid reliance on system sensor events and prevent a potential deadlock
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#ifndef SDL_EVENTS_DISABLED
|
||||
#include "../events/SDL_events_c.h"
|
||||
#endif
|
||||
#include "../joystick/SDL_gamepad_c.h"
|
||||
|
||||
static SDL_SensorDriver *SDL_sensor_drivers[] = {
|
||||
#ifdef SDL_SENSOR_ANDROID
|
||||
@@ -501,6 +502,9 @@ int SDL_SendSensorUpdate(Uint64 timestamp, SDL_Sensor *sensor, Uint64 sensor_tim
|
||||
posted = SDL_PushEvent(&event) == 1;
|
||||
}
|
||||
#endif /* !SDL_EVENTS_DISABLED */
|
||||
|
||||
SDL_GamepadSensorWatcher(timestamp, sensor->instance_id, sensor_timestamp, data, num_values);
|
||||
|
||||
return posted;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user