Skip to content

Commit cebdba5

Browse files
authored
Fix: Fixed COMException when removing focus from the path bar (#14356)
1 parent 71742c3 commit cebdba5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Files.App/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(()
167167
/// </summary>
168168
private void Window_Activated(object sender, WindowActivatedEventArgs args)
169169
{
170+
AppModel.IsMainWindowClosed = false;
171+
170172
// TODO(s): Is this code still needed?
171173
if (args.WindowActivationState != WindowActivationState.CodeActivated ||
172174
args.WindowActivationState != WindowActivationState.PointerActivated)

src/Files.App/UserControls/AddressToolbar.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ private void VisiblePath_KeyDown(object _, KeyRoutedEventArgs e)
9595
}
9696
private void VisiblePath_LostFocus(object _, RoutedEventArgs e)
9797
{
98+
if (App.AppModel.IsMainWindowClosed)
99+
return;
100+
98101
var element = FocusManager.GetFocusedElement(MainWindow.Instance.Content.XamlRoot);
99102
if (element is FlyoutBase or AppBarButton or Popup)
100103
return;

0 commit comments

Comments
 (0)