From d20c0184b7e1910aa768f514e77d9f518e360807 Mon Sep 17 00:00:00 2001 From: Saravanan Ganapathi Date: Fri, 21 Nov 2025 12:07:36 +0530 Subject: [PATCH 1/3] Fix: Increased minimum window size to prevent crash when resizing with multiple panes aligned vertically --- src/Files.App/MainWindow.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index a4d7b352c0c9..b8f1da8067cc 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -29,8 +29,8 @@ public MainWindow() InitializeComponent(); WindowHandle = WinUIEx.WindowExtensions.GetWindowHandle(this); - MinHeight = 316; - MinWidth = 416; + MinHeight = 646; + MinWidth = 850; ExtendsContentIntoTitleBar = true; Title = "Files"; PersistenceId = "FilesMainWindow"; From 3b4485ab6a5c6f88241feb0dcbf790d167897eed Mon Sep 17 00:00:00 2001 From: Saravanan Ganapathi Date: Fri, 5 Dec 2025 13:44:35 +0530 Subject: [PATCH 2/3] Fix: Fixed crash when resizing window with split panes active. Revert the min size requirements from the MainWindow --- src/Files.App/MainWindow.xaml.cs | 6 +++--- src/Files.App/Views/ShellPanesPage.xaml.cs | 13 ++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index b8f1da8067cc..6b386ceda0e2 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -28,9 +28,9 @@ public MainWindow() { InitializeComponent(); - WindowHandle = WinUIEx.WindowExtensions.GetWindowHandle(this); - MinHeight = 646; - MinWidth = 850; + WindowHandle = WinUIEx.WindowExtensions.GetWindowHandle(this); + MinHeight = 316; + MinWidth = 416; ExtendsContentIntoTitleBar = true; Title = "Files"; PersistenceId = "FilesMainWindow"; diff --git a/src/Files.App/Views/ShellPanesPage.xaml.cs b/src/Files.App/Views/ShellPanesPage.xaml.cs index 293e61616f42..cb45e91ecd94 100644 --- a/src/Files.App/Views/ShellPanesPage.xaml.cs +++ b/src/Files.App/Views/ShellPanesPage.xaml.cs @@ -32,6 +32,7 @@ public sealed partial class ShellPanesPage : Page, IShellPanesPage, ITabBarItemC // Fields private bool _wasRightPaneVisible; + private NavigationParams? _savedNavParamsRight; // Properties @@ -105,8 +106,12 @@ public bool WindowIsCompact // Close pane _wasRightPaneVisible = GetPaneCount() >= 2; - if (GetPaneCount() >= 2) + if (_wasRightPaneVisible) + { + var currentPath = GetPane(1)?.TabBarItemParameter?.NavigationParameter as string ?? "Home"; + _savedNavParamsRight = new NavigationParams { NavPath = currentPath }; RemovePane(1); + } } else if (_wasRightPaneVisible) { @@ -114,6 +119,12 @@ public bool WindowIsCompact if (GetPaneCount() == 1) AddPane(); + if (_savedNavParamsRight is not null) + { + NavParamsRight = _savedNavParamsRight; + _savedNavParamsRight = null; + } + _wasRightPaneVisible = false; } From 5305c7bf605c6a94d71dec76a2ddaa8aac4df3b0 Mon Sep 17 00:00:00 2001 From: Saravanan Ganapathi Date: Fri, 5 Dec 2025 13:46:56 +0530 Subject: [PATCH 3/3] Code Quality: Removed whitespace --- src/Files.App/MainWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/MainWindow.xaml.cs b/src/Files.App/MainWindow.xaml.cs index 6b386ceda0e2..a4d7b352c0c9 100644 --- a/src/Files.App/MainWindow.xaml.cs +++ b/src/Files.App/MainWindow.xaml.cs @@ -28,7 +28,7 @@ public MainWindow() { InitializeComponent(); - WindowHandle = WinUIEx.WindowExtensions.GetWindowHandle(this); + WindowHandle = WinUIEx.WindowExtensions.GetWindowHandle(this); MinHeight = 316; MinWidth = 416; ExtendsContentIntoTitleBar = true;