Skip to content

Commit a4b3ba4

Browse files
authored
Merge be7973f into 8cbdb79
2 parents 8cbdb79 + be7973f commit a4b3ba4

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

source/appModules/searchui.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2015-2021 NV Access Limited, Joseph Lee
2+
# Copyright (C) 2015-2022 NV Access Limited, Joseph Lee
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

66
"""App module for Start menu/Windows Search/Cortana user interface in Windows 10 Version 1909 and earlier.
7+
This app module also serves as the basis for Start menu in Windows 10 Version 2004 and later
8+
as well as Windows 11, represented by alias app modules.
79
"""
810

911
import appModuleHandler
@@ -12,11 +14,13 @@
1214
from NVDAObjects.IAccessible import IAccessible, ContentGenericClient
1315
from NVDAObjects.UIA import UIA, SearchField, SuggestionListItem
1416

17+
1518
class StartMenuSearchField(SearchField):
1619

1720
# #7370: do not announce text when start menu (searchui) closes.
1821
announceNewLineText = False
1922

23+
2024
class AppModule(appModuleHandler.AppModule):
2125

2226
def event_NVDAObject_init(self, obj):
@@ -32,7 +36,7 @@ def event_NVDAObject_init(self, obj):
3236
):
3337
obj.name = obj.firstChild.name
3438

35-
def chooseNVDAObjectOverlayClasses(self,obj,clsList):
39+
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
3640
if isinstance(obj, IAccessible):
3741
try:
3842
# #5288: Never use ContentGenericClient, as this uses displayModel
@@ -44,6 +48,12 @@ def chooseNVDAObjectOverlayClasses(self,obj,clsList):
4448
if obj.UIAAutomationId == "SearchTextBox":
4549
clsList.insert(0, StartMenuSearchField)
4650
# #10329: Since 2019, some suggestion items are grouped inside another suggestions list item.
51+
# #13544: grandparent must be checked due to redesign in 2019.
4752
# Because of this, result details will not be announced like in the past.
48-
elif obj.role == controlTypes.Role.LISTITEM and isinstance(obj.parent, SuggestionListItem):
53+
elif (
54+
obj.role == controlTypes.Role.LISTITEM and (
55+
isinstance(obj.parent, SuggestionListItem)
56+
or isinstance(obj.parent.parent, SuggestionListItem)
57+
)
58+
):
4959
clsList.insert(0, SuggestionListItem)

0 commit comments

Comments
 (0)