From 40210f8945932473e2c6f43eebf87b2f864c0715 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Mon, 26 Apr 2021 15:54:14 -0400 Subject: [PATCH] winrt: Always use a thread for joystick support --- src/joystick/windows/SDL_windowsjoystick.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index 4d6613eca..c2eebeef3 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -356,6 +356,15 @@ WINDOWS_JoystickInit(void) WINDOWS_JoystickDetect(); +#ifdef __WINRT__ + /* FIXME: WinRT silently does not support device notifications. + * Revisit this if UWP ever adds support in a future release. + */ + s_bJoystickThread = SDL_TRUE; + if (SDL_StartJoystickThread() < 0) { + return -1; + } +#else s_bJoystickThread = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_THREAD, SDL_FALSE); if (s_bJoystickThread) { if (SDL_StartJoystickThread() < 0) { @@ -366,6 +375,7 @@ WINDOWS_JoystickInit(void) return -1; } } +#endif return 0; }