Use borderless windowed mode as the default on macOS. Fixes #246

This commit is contained in:
Cameron Gutman 2019-06-29 14:58:27 -07:00
parent 1c225ed04d
commit 6ff845c53b
3 changed files with 20 additions and 2 deletions

View file

@ -328,6 +328,16 @@ Flickable {
AutoResizingComboBox {
// ignore setting the index at first, and actually set it when the component is loaded
Component.onCompleted: {
// Set the recommended option based on the OS
for (var i = 0; i < windowModeListModel.count; i++) {
var thisWm = windowModeListModel.get(i).val;
if (thisWm === StreamingPreferences.recommendedFullScreenMode) {
windowModeListModel.get(i).text += " (Recommended)"
windowModeListModel.move(i, 0, 1);
break
}
}
var savedWm = StreamingPreferences.windowMode
currentIndex = 0
for (var i = 0; i < windowModeListModel.count; i++) {
@ -346,7 +356,7 @@ Flickable {
model: ListModel {
id: windowModeListModel
ListElement {
text: "Full-screen (Recommended)"
text: "Full-screen"
val: StreamingPreferences.WM_FULLSCREEN
}
ListElement {

View file

@ -34,6 +34,12 @@ void StreamingPreferences::reload()
{
QSettings settings;
#ifdef Q_OS_DARWIN
recommendedFullScreenMode = WindowMode::WM_FULLSCREEN_DESKTOP;
#else
recommendedFullScreenMode = WindowMode::WM_FULLSCREEN;
#endif
width = settings.value(SER_WIDTH, 1280).toInt();
height = settings.value(SER_HEIGHT, 720).toInt();
fps = settings.value(SER_FPS, 60).toInt();
@ -58,7 +64,7 @@ void StreamingPreferences::reload()
windowMode = static_cast<WindowMode>(settings.value(SER_WINDOWMODE,
// Try to load from the old preference value too
static_cast<int>(settings.value(SER_FULLSCREEN, true).toBool() ?
WindowMode::WM_FULLSCREEN : WindowMode::WM_WINDOWED)).toInt());
recommendedFullScreenMode : WindowMode::WM_WINDOWED)).toInt());
}
void StreamingPreferences::save()

View file

@ -68,6 +68,7 @@ public:
Q_PROPERTY(VideoCodecConfig videoCodecConfig MEMBER videoCodecConfig NOTIFY videoCodecConfigChanged)
Q_PROPERTY(VideoDecoderSelection videoDecoderSelection MEMBER videoDecoderSelection NOTIFY videoDecoderSelectionChanged)
Q_PROPERTY(WindowMode windowMode MEMBER windowMode NOTIFY windowModeChanged)
Q_PROPERTY(WindowMode recommendedFullScreenMode MEMBER recommendedFullScreenMode CONSTANT)
// Directly accessible members for preferences
int width;
@ -89,6 +90,7 @@ public:
VideoCodecConfig videoCodecConfig;
VideoDecoderSelection videoDecoderSelection;
WindowMode windowMode;
WindowMode recommendedFullScreenMode;
signals:
void displayModeChanged();