Skip to content

Commit

Permalink
Pressing Enter to close Start menu in Windows 10 no longer results in…
Browse files Browse the repository at this point in the history
… NVDA announcing search field text. re #7370. (#7375)

* UIA/Search field: do not announce search field entry when searchui (start menu) is closing. re #7370.

due to use of announceNewlineText, when start menu closes and when Enter is pressed, search field value will be announced, which sometimes leads to side effects such as core freeze. Address this through initOverClass in UIA.SearchField that turns this flag off if and only if we're in start menu in Windows 10.

* SearchField/searchui: an overlay class just for Start menu version that disables announcement of newline text. re #7370.

Reviewed by Mick Curran (NV Access): better to create an overlay class for this just for searchui. This also allows easy modifications in the future if the need arises.
  • Loading branch information
josephsl authored and michaelDCurran committed Jul 25, 2017
1 parent ef223a9 commit 5041673
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion source/appModules/searchui.py
@@ -1,10 +1,16 @@
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2015-2016 NV Access Limited
#Copyright (C) 2015-2017 NV Access Limited, Joseph Lee
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

import appModuleHandler
from NVDAObjects.IAccessible import IAccessible, ContentGenericClient
from NVDAObjects.UIA import UIA, SearchField

class StartMenuSearchField(SearchField):

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

class AppModule(appModuleHandler.AppModule):

Expand All @@ -16,3 +22,6 @@ def chooseNVDAObjectOverlayClasses(self,obj,clsList):
clsList.remove(ContentGenericClient)
except ValueError:
pass
elif isinstance(obj, UIA):
if obj.UIAElement.cachedAutomationID == "SearchTextBox":
clsList.insert(0, StartMenuSearchField)

0 comments on commit 5041673

Please sign in to comment.