mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Use borderless windowed mode as the default on macOS. Fixes #246
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user