Windows Fullscreen Fixes (#87)

This PR fixes two bugs introduced in #80 :
- Exiting fullscreen could exit the Ryujinx window  (https://github.com/Ryubing/Issues/issues/415)
- Toggling fullscreen on would move the window to the primary monitor

And two other bugs related to input view :
- Exiting fullscreen when window was previously in a non maximized state now conserves the window coordinates and size properly (https://github.com/Ryubing/Issues/issues/425)
- Opening the ryujinx app no makes the app grow slightly larger vertically on each launch (+31px on my 1080p monitor) (https://github.com/Ryubing/Issues/issues/425)

Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/87
This commit is contained in:
Babib3l
2026-05-25 12:09:00 +00:00
committed by sh0inx
parent b62c58c2fe
commit b2310823c9
3 changed files with 79 additions and 11 deletions

View File

@@ -48,6 +48,8 @@ namespace Ryujinx.Ava.UI.Windows
private bool _isLoading;
private bool _applicationsLoadedOnce;
private double _windowStartupWidthDelta;
private double _windowStartupHeightDelta;
private UserChannelPersistence _userChannelPersistence;
private static bool _deferLoad;
@@ -477,8 +479,8 @@ namespace Ryujinx.Ava.UI.Windows
{
// Since scaling is being applied to the loaded settings from disk (see SetWindowSizePosition() above), scaling should be removed from width/height before saving out to disk
// as well - otherwise anyone not using a 1.0 scale factor their window will increase in size with every subsequent launch of the program when scaling is applied (Nov. 14, 2024)
ConfigurationState.Instance.UI.WindowStartup.WindowSizeHeight.Value = (int)(Height / Program.WindowScaleFactor);
ConfigurationState.Instance.UI.WindowStartup.WindowSizeWidth.Value = (int)(Width / Program.WindowScaleFactor);
ConfigurationState.Instance.UI.WindowStartup.WindowSizeHeight.Value = (int)((Height - _windowStartupHeightDelta) / Program.WindowScaleFactor);
ConfigurationState.Instance.UI.WindowStartup.WindowSizeWidth.Value = (int)((Width - _windowStartupWidthDelta) / Program.WindowScaleFactor);
ConfigurationState.Instance.UI.WindowStartup.WindowPositionX.Value = Position.X;
ConfigurationState.Instance.UI.WindowStartup.WindowPositionY.Value = Position.Y;
@@ -493,6 +495,9 @@ namespace Ryujinx.Ava.UI.Windows
Initialize();
_windowStartupWidthDelta = Math.Max(0, Width - ViewModel.WindowWidth);
_windowStartupHeightDelta = Math.Max(0, Height - ViewModel.WindowHeight);
PlatformSettings!.ColorValuesChanged += OnPlatformColorValuesChanged;
ViewModel.Initialize(