From af0921c5b26e816c4c7ad9d01823fa2fddf73d61 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 8 Jan 2021 18:14:49 -0600 Subject: [PATCH] Set new hints present in SDL 2.0.15 development builds --- app/main.cpp | 5 +++++ app/streaming/input/input.cpp | 16 +++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index cffd65d2..2b0a0214 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -394,6 +394,11 @@ int main(int argc, char *argv[]) // future KMSDRM platforms that use SDL for rendering. SDL_SetHint(SDL_HINT_VIDEO_DOUBLE_BUFFER, "1"); + // Use Direct3D 9Ex to avoid a deadlock caused by the D3D device being reset when + // the user triggers a UAC prompt. This option controls the software/SDL renderer. + // The DXVA2 renderer uses Direct3D 9Ex itself directly. + SDL_SetHint("SDL_WINDOWS_USE_D3D9EX", "1"); + if (SDL_InitSubSystem(SDL_INIT_TIMER) != 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_InitSubSystem(SDL_INIT_TIMER) failed: %s", diff --git a/app/streaming/input/input.cpp b/app/streaming/input/input.cpp index 6bd106ee..cf22658a 100644 --- a/app/streaming/input/input.cpp +++ b/app/streaming/input/input.cpp @@ -49,22 +49,12 @@ SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, NvComputer*, int s // relative mode, the click event will trigger the mouse to be recaptured. SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); -#if defined(Q_OS_DARWIN) && !SDL_VERSION_ATLEAST(2, 0, 10) - // SDL 2.0.9 on macOS has a broken HIDAPI mapping for the older Xbox One S - // firmware, so we have to disable HIDAPI for Xbox gamepads on macOS until - // SDL 2.0.10 where the bug is fixed. - // https://github.com/moonlight-stream/moonlight-qt/issues/133 - // https://bugzilla.libsdl.org/show_bug.cgi?id=4395 - SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_XBOX, "0"); -#endif - -#if SDL_VERSION_ATLEAST(2, 0, 9) - // Enabling extended input reports allows rumble to function on Bluetooth PS4 + // Enabling extended input reports allows rumble to function on Bluetooth PS4/PS5 // controllers, but breaks DirectInput applications. We will enable it because // it's likely that working rumble is what the user is expecting. If they don't // want this behavior, they can override it with the environment variable. - SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); -#endif + SDL_SetHint("SDL_JOYSTICK_HIDAPI_PS4_RUMBLE", "1"); + SDL_SetHint("SDL_JOYSTICK_HIDAPI_PS5_RUMBLE", "1"); m_OldIgnoreDevices = SDL_GetHint(SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES); m_OldIgnoreDevicesExcept = SDL_GetHint(SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT);