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
+11 -1
View File
@@ -328,6 +328,16 @@ Flickable {
AutoResizingComboBox { AutoResizingComboBox {
// ignore setting the index at first, and actually set it when the component is loaded // ignore setting the index at first, and actually set it when the component is loaded
Component.onCompleted: { 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 var savedWm = StreamingPreferences.windowMode
currentIndex = 0 currentIndex = 0
for (var i = 0; i < windowModeListModel.count; i++) { for (var i = 0; i < windowModeListModel.count; i++) {
@@ -346,7 +356,7 @@ Flickable {
model: ListModel { model: ListModel {
id: windowModeListModel id: windowModeListModel
ListElement { ListElement {
text: "Full-screen (Recommended)" text: "Full-screen"
val: StreamingPreferences.WM_FULLSCREEN val: StreamingPreferences.WM_FULLSCREEN
} }
ListElement { ListElement {
+7 -1
View File
@@ -34,6 +34,12 @@ void StreamingPreferences::reload()
{ {
QSettings settings; QSettings settings;
#ifdef Q_OS_DARWIN
recommendedFullScreenMode = WindowMode::WM_FULLSCREEN_DESKTOP;
#else
recommendedFullScreenMode = WindowMode::WM_FULLSCREEN;
#endif
width = settings.value(SER_WIDTH, 1280).toInt(); width = settings.value(SER_WIDTH, 1280).toInt();
height = settings.value(SER_HEIGHT, 720).toInt(); height = settings.value(SER_HEIGHT, 720).toInt();
fps = settings.value(SER_FPS, 60).toInt(); fps = settings.value(SER_FPS, 60).toInt();
@@ -58,7 +64,7 @@ void StreamingPreferences::reload()
windowMode = static_cast<WindowMode>(settings.value(SER_WINDOWMODE, windowMode = static_cast<WindowMode>(settings.value(SER_WINDOWMODE,
// 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() ?
WindowMode::WM_FULLSCREEN : WindowMode::WM_WINDOWED)).toInt()); recommendedFullScreenMode : WindowMode::WM_WINDOWED)).toInt());
} }
void StreamingPreferences::save() void StreamingPreferences::save()
+2
View File
@@ -68,6 +68,7 @@ public:
Q_PROPERTY(VideoCodecConfig videoCodecConfig MEMBER videoCodecConfig NOTIFY videoCodecConfigChanged) Q_PROPERTY(VideoCodecConfig videoCodecConfig MEMBER videoCodecConfig NOTIFY videoCodecConfigChanged)
Q_PROPERTY(VideoDecoderSelection videoDecoderSelection MEMBER videoDecoderSelection NOTIFY videoDecoderSelectionChanged) Q_PROPERTY(VideoDecoderSelection videoDecoderSelection MEMBER videoDecoderSelection NOTIFY videoDecoderSelectionChanged)
Q_PROPERTY(WindowMode windowMode MEMBER windowMode NOTIFY windowModeChanged) Q_PROPERTY(WindowMode windowMode MEMBER windowMode NOTIFY windowModeChanged)
Q_PROPERTY(WindowMode recommendedFullScreenMode MEMBER recommendedFullScreenMode CONSTANT)
// Directly accessible members for preferences // Directly accessible members for preferences
int width; int width;
@@ -89,6 +90,7 @@ public:
VideoCodecConfig videoCodecConfig; VideoCodecConfig videoCodecConfig;
VideoDecoderSelection videoDecoderSelection; VideoDecoderSelection videoDecoderSelection;
WindowMode windowMode; WindowMode windowMode;
WindowMode recommendedFullScreenMode;
signals: signals:
void displayModeChanged(); void displayModeChanged();