Allow use of old fullscreen mode on macOS by setting I_WANT_BUGGY_FULLSCREEN=1

This commit is contained in:
Cameron Gutman 2024-06-09 15:46:24 -05:00
parent b59de38e0b
commit d7bc735edc

View File

@ -566,6 +566,7 @@ Session::Session(NvComputer* computer, NvApp& app, StreamingPreferences *prefere
bool Session::initialize()
{
#ifdef Q_OS_DARWIN
if (qEnvironmentVariableIntValue("I_WANT_BUGGY_FULLSCREEN") == 0) {
// If we have a notch and the user specified one of the two native display modes
// (notched or notchless), override the fullscreen mode to ensure it works as expected.
// - SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES=0 will place the video underneath the notch
@ -603,6 +604,7 @@ bool Session::initialize()
// https://github.com/moonlight-stream/moonlight-qt/issues/1211
// https://github.com/moonlight-stream/moonlight-qt/issues/1218
SDL_SetHint(SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, shouldUseFullScreenSpaces ? "1" : "0");
}
#endif
if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) {
@ -790,8 +792,13 @@ bool Session::initialize()
// Fall-through
case StreamingPreferences::WM_FULLSCREEN:
#ifdef Q_OS_DARWIN
// Don't use "real" fullscreen on macOS. See comments above.
if (qEnvironmentVariableIntValue("I_WANT_BUGGY_FULLSCREEN") == 0) {
// Don't use "real" fullscreen on macOS by default. See comments above.
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN_DESKTOP;
}
else {
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN;
}
#else
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN;
#endif