From 6f53489e64cee38b2aeb183d91580af9bd421204 Mon Sep 17 00:00:00 2001 From: wencong Date: Fri, 8 May 2026 10:52:34 +0800 Subject: [PATCH 1/2] Fix File Explorer search box losing focus after Ctrl+F (#20022) Fixes #20021 Summary of the issue: In File Explorer on Windows 10, pressing Ctrl+F should move focus directly to the search edit field. Since NVDA 2026.1 beta, NVDA first reports the search edit field, but then reports a pane, so users need to press Ctrl+F a second time before they can reliably type in the search box. This is a regression from #19117. That PR removed several old Windows 8.x Start screen workarounds from the Explorer app module, including SearchBoxClient. Although that class was described as a Windows 8 workaround, it was still filtering a redundant File Explorer search band focus event. On Windows 10, the redundant object has: role == controlTypes.Role.PANE windowClassName == "Search Box" Description of user facing changes: Same behavior as before 2026.1Beta. Description of developer facing changes: Restores a small Explorer app module overlay for File Explorer search band pane objects. The overlay suppresses redundant IAccessible focus events from Search Box and UniversalSearchBand pane objects. Search Box has been confirmed on Windows 10. UniversalSearchBand is retained from the pre-#19117 filter because it appears to be another Explorer search band class, and the match is still limited to IAccessible pane objects. Description of development approach: This keeps the #19117 cleanup intact, except for the part that affected File Explorer search focus. The Windows 8 Start screen tile, group, launcher, and suggestion overlays are not restored. --- source/appModules/explorer.py | 14 ++++++++++++++ user_docs/en/changes.md | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/source/appModules/explorer.py b/source/appModules/explorer.py index 7f716078ebc..aef427a9095 100644 --- a/source/appModules/explorer.py +++ b/source/appModules/explorer.py @@ -45,6 +45,12 @@ def _get_container(self): return super(MultitaskingViewFrameListItem, self).container +class SearchBoxClient(IAccessible): + # #20021: File Explorer can fire a redundant MSAA focus event on the search band pane + # immediately after the UIA SearchEditBox gains focus. + shouldAllowIAccessibleFocusEvent = False + + # Class for menu items for Windows Places and Frequently used Programs (in start menu) # Also used for desktop items class SysListView32EmittingDuplicateFocusEvents(IAccessible): @@ -213,6 +219,14 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList): # NOQA: C901 windowClass = obj.windowClassName role = obj.role + if ( + windowClass in ("Search Box", "UniversalSearchBand") + and role == controlTypes.Role.PANE + and isinstance(obj, IAccessible) + ): + clsList.insert(0, SearchBoxClient) + return # Optimization: return early to avoid comparing class names and roles that will never match. + if windowClass == "ToolbarWindow32": if role != controlTypes.Role.POPUPMENU: try: diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index debfdfdb008..d8f5daeaccc 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -11,6 +11,10 @@ Please responsibly disclose security issues following NVDA's [security policy](h * Fixed an issue which could cause NVDA to connect to an untrusted Remote Access server. ([GHSA-m268-mc77-j2cr](https://github.com/nvaccess/nvda/security/advisories/GHSA-m268-mc77-j2cr)) * Prevents a situation which could cause unselected add-ons to be copied to the system-wide configuration. ([GHSA-669f-7gpr-5vqm](https://github.com/nvaccess/nvda/security/advisories/GHSA-669f-7gpr-5vqm)) +### Bug Fixes + +* In File Explorer, pressing `ctrl+f` once again focuses the search box without subsequently reporting a pane. (#20021, @Cary-rowen) + From fe363f291ff19b8178e51b4407a0484e7d5081ce Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Fri, 15 May 2026 12:13:20 +1000 Subject: [PATCH 2/2] Apply suggestion from @seanbudd --- user_docs/en/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index d8f5daeaccc..a68e1243998 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -3,6 +3,7 @@ ## 2026.1.1 This is a patch release to fix a security issue. +A bug fix is also included for an issue introduced in 2026.1 with how `ctrl+f` is handled in File Explorer. ### Security fixes