From f4408473e6a080ce6a0a1f7b6e8807e9bd1a78ea Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 16 Sep 2018 11:21:15 -0700 Subject: [PATCH] Fix broken Alt+Tab behavior. Fixes #72 --- app/streaming/session.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 685c5697..3675b236 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -980,7 +980,10 @@ void Session::exec(int displayOriginX, int displayOriginY) // Release mouse cursor when another window is activated (e.g. by using ALT+TAB). // This lets user to interact with our window's title bar and with the buttons in it. - if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) { + // Doing this while the window is full-screen breaks the transition out of FS + // (desktop and exclusive), so we must check for that before releasing mouse capture. + if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST && + !(SDL_GetWindowFlags(m_Window) & SDL_WINDOW_FULLSCREEN)) { SDL_SetRelativeMouseMode(SDL_FALSE); }