mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Don't overwrite window mode settings when switching between WM and non-WM environments
This commit is contained in:
parent
3bd6a6a614
commit
6dab251055
@ -525,6 +525,11 @@ 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: {
|
||||||
|
if (!visible) {
|
||||||
|
// Do nothing if the control won't even be visible
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Set the recommended option based on the OS
|
// Set the recommended option based on the OS
|
||||||
for (var i = 0; i < windowModeListModel.count; i++) {
|
for (var i = 0; i < windowModeListModel.count; i++) {
|
||||||
var thisWm = windowModeListModel.get(i).val;
|
var thisWm = windowModeListModel.get(i).val;
|
||||||
@ -537,15 +542,13 @@ Flickable {
|
|||||||
|
|
||||||
currentIndex = 0
|
currentIndex = 0
|
||||||
|
|
||||||
if (SystemProperties.hasWindowManager && !SystemProperties.rendererAlwaysFullScreen) {
|
var savedWm = StreamingPreferences.windowMode
|
||||||
var savedWm = StreamingPreferences.windowMode
|
for (var i = 0; i < windowModeListModel.count; i++) {
|
||||||
for (var i = 0; i < windowModeListModel.count; i++) {
|
var thisWm = windowModeListModel.get(i).val;
|
||||||
var thisWm = windowModeListModel.get(i).val;
|
if (savedWm === thisWm) {
|
||||||
if (savedWm === thisWm) {
|
currentIndex = i
|
||||||
currentIndex = i
|
break
|
||||||
break
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
activated(currentIndex)
|
activated(currentIndex)
|
||||||
@ -792,20 +795,19 @@ 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: {
|
||||||
if (SystemProperties.hasWindowManager) {
|
if (!visible) {
|
||||||
var saved_uidisplaymode = StreamingPreferences.uiDisplayMode
|
// Do nothing if the control won't even be visible
|
||||||
currentIndex = 0
|
return
|
||||||
for (var i = 0; i < uiDisplayModeListModel.count; i++) {
|
|
||||||
var el_uidisplaymode = uiDisplayModeListModel.get(i).val;
|
|
||||||
if (saved_uidisplaymode === el_uidisplaymode) {
|
|
||||||
currentIndex = i
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// Full-screen is always selected when there is no window manager
|
var saved_uidisplaymode = StreamingPreferences.uiDisplayMode
|
||||||
currentIndex = 2
|
currentIndex = 0
|
||||||
|
for (var i = 0; i < uiDisplayModeListModel.count; i++) {
|
||||||
|
var el_uidisplaymode = uiDisplayModeListModel.get(i).val;
|
||||||
|
if (saved_uidisplaymode === el_uidisplaymode) {
|
||||||
|
currentIndex = i
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activated(currentIndex)
|
activated(currentIndex)
|
||||||
|
@ -340,6 +340,10 @@ bool Session::populateDecoderProperties(SDL_Window* window)
|
|||||||
|
|
||||||
m_StreamConfig.colorSpace = decoder->getDecoderColorspace();
|
m_StreamConfig.colorSpace = decoder->getDecoderColorspace();
|
||||||
|
|
||||||
|
if (decoder->isAlwaysFullScreen()) {
|
||||||
|
m_IsFullScreen = true;
|
||||||
|
}
|
||||||
|
|
||||||
delete decoder;
|
delete decoder;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -347,6 +351,7 @@ bool Session::populateDecoderProperties(SDL_Window* window)
|
|||||||
|
|
||||||
Session::Session(NvComputer* computer, NvApp& app, StreamingPreferences *preferences)
|
Session::Session(NvComputer* computer, NvApp& app, StreamingPreferences *preferences)
|
||||||
: m_Preferences(preferences ? preferences : new StreamingPreferences(this)),
|
: m_Preferences(preferences ? preferences : new StreamingPreferences(this)),
|
||||||
|
m_IsFullScreen(m_Preferences->windowMode != StreamingPreferences::WM_WINDOWED || !WMUtils::isRunningWindowManager()),
|
||||||
m_Computer(computer),
|
m_Computer(computer),
|
||||||
m_App(app),
|
m_App(app),
|
||||||
m_Window(nullptr),
|
m_Window(nullptr),
|
||||||
@ -506,8 +511,12 @@ bool Session::initialize()
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case StreamingPreferences::WM_FULLSCREEN_DESKTOP:
|
case StreamingPreferences::WM_FULLSCREEN_DESKTOP:
|
||||||
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
// Only use full-screen desktop mode if we're running a window manager
|
||||||
break;
|
if (WMUtils::isRunningWindowManager()) {
|
||||||
|
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Fall-through
|
||||||
case StreamingPreferences::WM_FULLSCREEN:
|
case StreamingPreferences::WM_FULLSCREEN:
|
||||||
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN;
|
m_FullScreenFlag = SDL_WINDOW_FULLSCREEN;
|
||||||
break;
|
break;
|
||||||
@ -817,7 +826,7 @@ void Session::getWindowDimensions(int& x, int& y,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fullScreen = (m_Preferences->windowMode != StreamingPreferences::WM_WINDOWED);
|
fullScreen = m_IsFullScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Rect usableBounds;
|
SDL_Rect usableBounds;
|
||||||
@ -1212,7 +1221,7 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
|||||||
// For non-full screen windows, call getWindowDimensions()
|
// For non-full screen windows, call getWindowDimensions()
|
||||||
// again after creating a window to allow it to account
|
// again after creating a window to allow it to account
|
||||||
// for window chrome size.
|
// for window chrome size.
|
||||||
if (m_Preferences->windowMode == StreamingPreferences::WM_WINDOWED) {
|
if (!m_IsFullScreen) {
|
||||||
getWindowDimensions(x, y, width, height);
|
getWindowDimensions(x, y, width, height);
|
||||||
|
|
||||||
// We must set the size before the position because centering
|
// We must set the size before the position because centering
|
||||||
|
@ -133,6 +133,7 @@ private:
|
|||||||
int drSubmitDecodeUnit(PDECODE_UNIT du);
|
int drSubmitDecodeUnit(PDECODE_UNIT du);
|
||||||
|
|
||||||
StreamingPreferences* m_Preferences;
|
StreamingPreferences* m_Preferences;
|
||||||
|
bool m_IsFullScreen;
|
||||||
STREAM_CONFIGURATION m_StreamConfig;
|
STREAM_CONFIGURATION m_StreamConfig;
|
||||||
DECODER_RENDERER_CALLBACKS m_VideoCallbacks;
|
DECODER_RENDERER_CALLBACKS m_VideoCallbacks;
|
||||||
AUDIO_RENDERER_CALLBACKS m_AudioCallbacks;
|
AUDIO_RENDERER_CALLBACKS m_AudioCallbacks;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user