2 Commits

Author SHA1 Message Date
maj00r
6948b13503 Merge pull request #35 from dos1/fullscreen
Maximize the window automatically when running in gamescope or Steam Big Picture
2026-10-31 22:10:26 +01:00
Sebastian Krzyszkowiak
22c51ddf3c Maximize the window automatically when running in gamescope or Steam Big Picture 2026-10-28 07:08:29 +01:00
2 changed files with 16 additions and 3 deletions

View File

@@ -236,7 +236,7 @@ jobs:
# Windows .zip a file - unpacked, its contents would end up in the release # Windows .zip a file - unpacked, its contents would end up in the release
# instead of the package. # instead of the package.
- name: Collect the packages - name: Collect the packages
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with: with:
path: dist path: dist
merge-multiple: true merge-multiple: true

View File

@@ -38,7 +38,7 @@ public partial class MainWindow : Window
ExtendClientAreaToDecorationsHint = true; ExtendClientAreaToDecorationsHint = true;
ExtendClientAreaTitleBarHeightHint = TitleBarHeight; ExtendClientAreaTitleBarHeightHint = TitleBarHeight;
if (AppServices.Current.Settings.WindowMaximized) if (AppServices.Current.Settings.WindowMaximized || wantsMaximized())
WindowState = WindowState.Maximized; WindowState = WindowState.Maximized;
PropertyChanged += (_, e) => PropertyChanged += (_, e) =>
@@ -309,6 +309,19 @@ public partial class MainWindow : Window
menu.Open(HelpButton); 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) private void linkClick(object? sender, RoutedEventArgs e)
{ {
if (sender is not Button btn) if (sender is not Button btn)
@@ -627,6 +640,6 @@ public partial class MainWindow : Window
if (!IsVisible) if (!IsVisible)
Show(); Show();
if (WindowState == WindowState.Minimized) if (WindowState == WindowState.Minimized)
WindowState = WindowState.Normal; WindowState = wantsMaximized() ? WindowState.Maximized : WindowState.Normal;
} }
} }