Skip to content

Fix: Fixed issue where inactive pane stole focus on file change #17428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Files.App/ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public sealed partial class ShellViewModel : ObservableObject, IDisposable
private readonly IStorageCacheService fileListCache = Ioc.Default.GetRequiredService<IStorageCacheService>();
private readonly IWindowsSecurityService WindowsSecurityService = Ioc.Default.GetRequiredService<IWindowsSecurityService>();
private readonly IStorageTrashBinService StorageTrashBinService = Ioc.Default.GetRequiredService<IStorageTrashBinService>();
private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();

// Only used for Binding and ApplyFilesAndFoldersChangesAsync, don't manipulate on this!
public BulkConcurrentObservableCollection<ListedItem> FilesAndFolders { get; }
Expand Down Expand Up @@ -873,6 +874,11 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() =>

private Task RequestSelectionAsync(List<ListedItem> itemsToSelect)
{
// Don't notify if shell page is not the active pane (eg. Dual Pane)
// https://github.com/files-community/Files/issues/17427
if (WorkingDirectory != ContentPageContext.ShellPage!.ShellViewModel.WorkingDirectory)
return Task.CompletedTask;

// Don't notify if there weren't listed items
if (itemsToSelect is null || itemsToSelect.IsEmpty())
return Task.CompletedTask;
Expand Down
Loading