From 22c51ddf3c257b76bbf3d245f4a33c20601d088a Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Tue, 27 Oct 2026 03:07:01 +0100 Subject: [PATCH] Maximize the window automatically when running in gamescope or Steam Big Picture --- StarterNG/MainWindow.axaml.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/StarterNG/MainWindow.axaml.cs b/StarterNG/MainWindow.axaml.cs index 03864d9..a827c5a 100644 --- a/StarterNG/MainWindow.axaml.cs +++ b/StarterNG/MainWindow.axaml.cs @@ -38,7 +38,7 @@ public partial class MainWindow : Window ExtendClientAreaToDecorationsHint = true; ExtendClientAreaTitleBarHeightHint = TitleBarHeight; - if (AppServices.Current.Settings.WindowMaximized) + if (AppServices.Current.Settings.WindowMaximized || wantsMaximized()) WindowState = WindowState.Maximized; PropertyChanged += (_, e) => @@ -309,6 +309,19 @@ public partial class MainWindow : Window menu.Open(HelpButton); } + private bool wantsMaximized() + { + // make sure the window fills the whole screen on gamescope sessions + if (Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope") + return true; + + // catch being launched via Steam Big Picture mode as well + if (Environment.GetEnvironmentVariable("SteamGamepadUI") == "1") + return true; + + return false; + } + private void linkClick(object? sender, RoutedEventArgs e) { if (sender is not Button btn) @@ -627,6 +640,6 @@ public partial class MainWindow : Window if (!IsVisible) Show(); if (WindowState == WindowState.Minimized) - WindowState = WindowState.Normal; + WindowState = wantsMaximized() ? WindowState.Maximized : WindowState.Normal; } }