mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-03-04 14:47:18 +00:00
Use borderless windowed mode as the default on macOS. Fixes #246
This commit is contained in:
parent
1c225ed04d
commit
6ff845c53b
3 changed files with 20 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue