mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-05 19:59:13 +02:00
Windows Fullscreen Fixes
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)
This commit is contained in:
@@ -42,6 +42,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;
|
||||
@@ -473,8 +475,8 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
// Only save rectangle properties if the window is not in a maximized state.
|
||||
if (WindowState != WindowState.Maximized)
|
||||
{
|
||||
ConfigurationState.Instance.UI.WindowStartup.WindowSizeHeight.Value = (int)Height;
|
||||
ConfigurationState.Instance.UI.WindowStartup.WindowSizeWidth.Value = (int)Width;
|
||||
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;
|
||||
@@ -489,13 +491,10 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
Initialize();
|
||||
|
||||
/// <summary>
|
||||
/// Subscribe to the ColorValuesChanged event
|
||||
/// </summary>
|
||||
if (PlatformSettings != null)
|
||||
{
|
||||
PlatformSettings.ColorValuesChanged += OnPlatformColorValuesChanged;
|
||||
}
|
||||
_windowStartupWidthDelta = Math.Max(0, Width - ViewModel.WindowWidth);
|
||||
_windowStartupHeightDelta = Math.Max(0, Height - ViewModel.WindowHeight);
|
||||
|
||||
PlatformSettings?.ColorValuesChanged += OnPlatformColorValuesChanged;
|
||||
|
||||
ViewModel.Initialize(
|
||||
ContentManager,
|
||||
|
||||
Reference in New Issue
Block a user