mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-05 15:58:46 +00:00
Update default window mode on macOS after upgrading
This commit is contained in:
parent
66a123f4b9
commit
be33b5b387
1 changed files with 16 additions and 0 deletions
|
@ -25,6 +25,9 @@
|
||||||
#define SER_CONNWARNINGS "connwarnings"
|
#define SER_CONNWARNINGS "connwarnings"
|
||||||
#define SER_RICHPRESENCE "richpresence"
|
#define SER_RICHPRESENCE "richpresence"
|
||||||
#define SER_GAMEPADMOUSE "gamepadmouse"
|
#define SER_GAMEPADMOUSE "gamepadmouse"
|
||||||
|
#define SER_DEFAULTVER "defaultver"
|
||||||
|
|
||||||
|
#define CURRENT_DEFAULT_VER 1
|
||||||
|
|
||||||
StreamingPreferences::StreamingPreferences(QObject *parent)
|
StreamingPreferences::StreamingPreferences(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
@ -36,6 +39,8 @@ void StreamingPreferences::reload()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
|
int defaultVer = settings.value(SER_DEFAULTVER, 0).toInt();
|
||||||
|
|
||||||
#ifdef Q_OS_DARWIN
|
#ifdef Q_OS_DARWIN
|
||||||
recommendedFullScreenMode = WindowMode::WM_FULLSCREEN_DESKTOP;
|
recommendedFullScreenMode = WindowMode::WM_FULLSCREEN_DESKTOP;
|
||||||
#else
|
#else
|
||||||
|
@ -69,6 +74,16 @@ void StreamingPreferences::reload()
|
||||||
// Try to load from the old preference value too
|
// Try to load from the old preference value too
|
||||||
static_cast<int>(settings.value(SER_FULLSCREEN, true).toBool() ?
|
static_cast<int>(settings.value(SER_FULLSCREEN, true).toBool() ?
|
||||||
recommendedFullScreenMode : WindowMode::WM_WINDOWED)).toInt());
|
recommendedFullScreenMode : WindowMode::WM_WINDOWED)).toInt());
|
||||||
|
|
||||||
|
// Perform default settings updates as required based on last default version
|
||||||
|
if (defaultVer == 0) {
|
||||||
|
#ifdef Q_OS_DARWIN
|
||||||
|
// Update window mode setting on macOS from full-screen (old default) to borderless windowed (new default)
|
||||||
|
if (windowMode == WindowMode::WM_FULLSCREEN) {
|
||||||
|
windowMode = WindowMode::WM_FULLSCREEN_DESKTOP;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StreamingPreferences::save()
|
void StreamingPreferences::save()
|
||||||
|
@ -96,6 +111,7 @@ void StreamingPreferences::save()
|
||||||
settings.setValue(SER_VIDEOCFG, static_cast<int>(videoCodecConfig));
|
settings.setValue(SER_VIDEOCFG, static_cast<int>(videoCodecConfig));
|
||||||
settings.setValue(SER_VIDEODEC, static_cast<int>(videoDecoderSelection));
|
settings.setValue(SER_VIDEODEC, static_cast<int>(videoDecoderSelection));
|
||||||
settings.setValue(SER_WINDOWMODE, static_cast<int>(windowMode));
|
settings.setValue(SER_WINDOWMODE, static_cast<int>(windowMode));
|
||||||
|
settings.setValue(SER_DEFAULTVER, CURRENT_DEFAULT_VER);
|
||||||
}
|
}
|
||||||
|
|
||||||
int StreamingPreferences::getDefaultBitrate(int width, int height, int fps)
|
int StreamingPreferences::getDefaultBitrate(int width, int height, int fps)
|
||||||
|
|
Loading…
Reference in a new issue