From 0fa0ab43c9b52045a1151c8847e7aade1755cfd9 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 20 Aug 2018 22:48:48 -0700 Subject: [PATCH] Fix broken Alt+Tab behavior on Windows --- app/streaming/video/ffmpeg-renderers/dxva2.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/dxva2.cpp b/app/streaming/video/ffmpeg-renderers/dxva2.cpp index e38ed503..bbf80f27 100644 --- a/app/streaming/video/ffmpeg-renderers/dxva2.cpp +++ b/app/streaming/video/ffmpeg-renderers/dxva2.cpp @@ -608,6 +608,13 @@ bool DXVA2Renderer::initialize(SDL_Window* window, int videoFormat, int width, i return false; } + // For some reason, using Direct3D9Ex breaks this with multi-monitor setups. + // When focus is lost, the window is minimized then immediately restored without + // input focus. This glitches out the renderer and a bunch of other stuff. + // Direct3D9Ex itself seems to have this minimize on focus loss behavior on its + // own, so just disable SDL's handling of the focus loss event. + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); + return true; }