Skip to content

Commit 6132c6c

Browse files
authored
Merge 4a0cff6 into 6668e22
2 parents 6668e22 + 4a0cff6 commit 6132c6c

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

source/IAccessibleHandler/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,13 @@ def processMenuStartWinEvent(eventID, window, objectID, childID, validFocus):
990990
if obj.IAccessibleRole != oleacc.ROLE_SYSTEM_MENUPOPUP:
991991
# menuStart on anything other than a menu is silly.
992992
return
993+
elif not obj.shouldAllowIAccessibleMenuStartEvent:
994+
if isMSAADebugLoggingEnabled():
995+
log.debug(
996+
f"Ignoring menuStart winEvent: {getWinEventLogInfo(window, objectID, childID)}, "
997+
f"shouldAllowIAccessibleMenuStartEvent {obj.shouldAllowIAccessibleMenuStartEvent}"
998+
)
999+
return
9931000
processFocusNVDAEvent(obj, force=True)
9941001

9951002

source/NVDAObjects/IAccessible/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,13 @@ def _get_shouldAllowIAccessibleFocusEvent(self):
694694
return False
695695
return True
696696

697+
def _get_shouldAllowIAccessibleMenuStartEvent(self) -> bool:
698+
"""Determine whether an IAccessible menu start or menu popup start event should be allowed
699+
for this object.
700+
@return: C{True} if the event should be allowed.
701+
"""
702+
return True
703+
697704
def _get_TextInfo(self):
698705
if hasattr(self,'IAccessibleTextObject'):
699706
return IA2TextTextInfo

source/appModules/teams.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2020 NV Access Limited, Leonard de Ruijter
3+
# This file is covered by the GNU General Public License.
4+
# See the file COPYING for more details.
5+
6+
""" App module for Microsoft Teams.
7+
"""
8+
9+
import appModuleHandler
10+
from NVDAObjects.IAccessible.ia2Web import Ia2Web
11+
12+
13+
class PopOverMenu(Ia2Web):
14+
shouldAllowIAccessibleMenuStartEvent = False
15+
16+
17+
class AppModule(appModuleHandler.AppModule):
18+
19+
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
20+
if (
21+
Ia2Web in clsList
22+
and obj.IA2Attributes.get("xml-roles") == "menu"
23+
and obj.parent
24+
and obj.parent.parent
25+
and "message-actions-popover-container" in obj.parent.parent.IA2Attributes.get("class", "")
26+
):
27+
clsList.insert(0, PopOverMenu)

0 commit comments

Comments
 (0)