From 509f6d738cb64d29bfea2f0d725e3f149ffaf721 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 21 Oct 2024 02:42:32 -0500 Subject: [PATCH 1/2] Revert Maximized = Fullscreen changes, fixes #20 --- .github/workflows/release.yml | 6 ++++++ src/Ryujinx/AppHost.cs | 6 +++--- src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs | 6 +++--- src/Ryujinx/UI/Windows/MainWindow.axaml.cs | 12 ++---------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2875611b..2a2cefe71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,7 @@ jobs: id: version_info run: | echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT + echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT shell: bash - name: Create tag @@ -51,6 +52,7 @@ jobs: with: name: ${{ steps.version_info.outputs.build_version }} tag: ${{ steps.version_info.outputs.build_version }} + body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}" omitBodyDuringUpdate: true owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} @@ -79,6 +81,7 @@ jobs: id: version_info run: | echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT + echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT shell: bash @@ -132,6 +135,7 @@ jobs: name: ${{ steps.version_info.outputs.build_version }} artifacts: "release_output/*.tar.gz,release_output/*.zip" tag: ${{ steps.version_info.outputs.build_version }} + body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}" omitBodyDuringUpdate: true allowUpdates: true replacesArtifacts: true @@ -170,6 +174,7 @@ jobs: id: version_info run: | echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT + echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT - name: Configure for release @@ -196,6 +201,7 @@ jobs: name: ${{ steps.version_info.outputs.build_version }} artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz" tag: ${{ steps.version_info.outputs.build_version }} + body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}" omitBodyDuringUpdate: true allowUpdates: true replacesArtifacts: true diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 9e1194ca1..5bcb58218 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -964,10 +964,10 @@ private void RenderLoop() { if (_viewModel.StartGamesInFullscreen) { - _viewModel.WindowState = MainWindow.FullScreenWindowState; + _viewModel.WindowState = WindowState.FullScreen; } - if (_viewModel.WindowState == MainWindow.FullScreenWindowState) + if (_viewModel.WindowState is WindowState.FullScreen) { _viewModel.ShowMenuAndStatusBar = false; } @@ -1138,7 +1138,7 @@ private bool UpdateFrame() Dispatcher.UIThread.Post(() => { - if (_keyboardInterface.GetKeyboardStateSnapshot().IsPressed(Key.Delete) && _viewModel.WindowState != MainWindow.FullScreenWindowState) + if (_keyboardInterface.GetKeyboardStateSnapshot().IsPressed(Key.Delete) && _viewModel.WindowState is not WindowState.FullScreen) { Device.Processes.ActiveApplication.DiskCacheLoadState?.Cancel(); } diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index 23e977fab..ce6ae5b7f 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -1426,7 +1426,7 @@ public void ToggleDockMode() public async Task ExitCurrentState() { - if (WindowState == MainWindow.FullScreenWindowState) + if (WindowState is WindowState.FullScreen) { ToggleFullscreen(); } @@ -1754,7 +1754,7 @@ public void ToggleFullscreen() } else { - WindowState = MainWindow.FullScreenWindowState; + WindowState = WindowState.FullScreen; if (IsGameRunning) { @@ -1762,7 +1762,7 @@ public void ToggleFullscreen() } } - IsFullScreen = WindowState == MainWindow.FullScreenWindowState; + IsFullScreen = WindowState is WindowState.FullScreen; } public static void SaveConfig() diff --git a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs index 9d633253a..ca6cd9fac 100644 --- a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs @@ -67,14 +67,6 @@ public partial class MainWindow : StyleableAppWindow public readonly double StatusBarHeight; public readonly double MenuBarHeight; - // The special window decoration from AppWindow in FluentAvalonia is only present on Windows; - // and as such optimizing for the fact that the menu bar and the title bar are the same is only needed on Windows. - // Maximized is considered superior to FullScreen on Windows in this case because you get the benefits of being in full screen, - // while still being able to use the standard 3 window controls in the top right to minimize, make the window smaller, or close the app. - - public static readonly WindowState FullScreenWindowState = - OperatingSystem.IsWindows() ? WindowState.Maximized : WindowState.FullScreen; - public MainWindow() { DataContext = ViewModel = new MainWindowViewModel @@ -193,7 +185,7 @@ public void SwitchToGameControl(bool startFullscreen = false) ViewModel.ShowContent = true; ViewModel.IsLoadingIndeterminate = false; - if (startFullscreen && ViewModel.WindowState != MainWindow.FullScreenWindowState) + if (startFullscreen && ViewModel.WindowState is not WindowState.FullScreen) { ViewModel.ToggleFullscreen(); } @@ -205,7 +197,7 @@ public void ShowLoading(bool startFullscreen = false) ViewModel.ShowLoadProgress = true; ViewModel.IsLoadingIndeterminate = true; - if (startFullscreen && ViewModel.WindowState != MainWindow.FullScreenWindowState) + if (startFullscreen && ViewModel.WindowState is not WindowState.FullScreen) { ViewModel.ToggleFullscreen(); } From 8b75ce1d981c68a81101c6234e50a74d13ed8f15 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 21 Oct 2024 02:42:53 -0500 Subject: [PATCH 2/2] misc: Fix the issues blocking PRs --- src/Ryujinx.Input.SDL2/SDL2Mouse.cs | 1 + src/Ryujinx.Input.SDL2/SDL2MouseDriver.cs | 1 + src/Ryujinx.UI.Common/App/ApplicationData.cs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Input.SDL2/SDL2Mouse.cs b/src/Ryujinx.Input.SDL2/SDL2Mouse.cs index 6dfd75984..37b356b76 100644 --- a/src/Ryujinx.Input.SDL2/SDL2Mouse.cs +++ b/src/Ryujinx.Input.SDL2/SDL2Mouse.cs @@ -83,6 +83,7 @@ public void SetTriggerThreshold(float triggerThreshold) public void Dispose() { + GC.SuppressFinalize(this); _driver = null; } } diff --git a/src/Ryujinx.Input.SDL2/SDL2MouseDriver.cs b/src/Ryujinx.Input.SDL2/SDL2MouseDriver.cs index 286164049..768ea8c62 100644 --- a/src/Ryujinx.Input.SDL2/SDL2MouseDriver.cs +++ b/src/Ryujinx.Input.SDL2/SDL2MouseDriver.cs @@ -171,6 +171,7 @@ public void Dispose() return; } + GC.SuppressFinalize(this); _isDisposed = true; } } diff --git a/src/Ryujinx.UI.Common/App/ApplicationData.cs b/src/Ryujinx.UI.Common/App/ApplicationData.cs index c2c0d0b4c..b1e346291 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationData.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationData.cs @@ -19,7 +19,7 @@ namespace Ryujinx.UI.App.Common { public class ApplicationData { - public static Func LocalizedNever = () => "Never"; + public static Func LocalizedNever { get; set; } = () => "Never"; public bool Favorite { get; set; } public byte[] Icon { get; set; }