From d1823dd6e13793f60df639a81c20aa4db988c99f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 25 Apr 2020 13:01:15 -0700 Subject: [PATCH] Capture the mouse by default always on release builds and in absolute mode for debug builds --- app/streaming/session.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index b6e2b2a8..28af6f4e 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1115,11 +1115,13 @@ void Session::exec(int displayOriginX, int displayOriginY) bool needsFirstEnterCapture = false; + // Capture the mouse in relative mode by default on release builds only. + // This prevents the mouse from becoming trapped inside Moonlight when + // it's halted at a debug break. #ifndef QT_DEBUG - // Capture the mouse by default on release builds only. - // This prevents the mouse from becoming trapped inside - // Moonlight when it's halted at a debug break. - if (m_Preferences->windowMode != StreamingPreferences::WM_WINDOWED) { + if (prefs.absoluteMouseMode) +#endif + { // HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER // event where it seems to work consistently on GNOME. if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0) { @@ -1129,7 +1131,6 @@ void Session::exec(int displayOriginX, int displayOriginY) needsFirstEnterCapture = true; } } -#endif // Stop text input. SDL enables it by default // when we initialize the video subsystem, but this