From 3f519980655a5d2992ab1e6e471eab1f95bca9d3 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 30 Oct 2022 11:56:15 -0500 Subject: [PATCH] Start the streaming window maximized if the GUI was maximized Fixes #889 --- app/streaming/session.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 028b0393..d204a474 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -1397,7 +1397,19 @@ void Session::execInternal() SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); // We always want a resizable window with High DPI enabled - const Uint32 defaultWindowFlags = SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_RESIZABLE; + Uint32 defaultWindowFlags = SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_RESIZABLE; + + // If we're starting in windowed mode and the Moonlight GUI is maximized, + // match that with the streaming window. + if (!m_IsFullScreen) { + QWindowList windows = QGuiApplication::topLevelWindows(); + for (const QWindow* window : windows) { + if (window->windowState() & Qt::WindowMaximized) { + defaultWindowFlags |= SDL_WINDOW_MAXIMIZED; + break; + } + } + } m_Window = SDL_CreateWindow("Moonlight", x,