Skip to content

Commit

Permalink
In Windows 10, NVDA no longer reports "unknown" after pressing alt+tab.
Browse files Browse the repository at this point in the history
Re #5116.
  • Loading branch information
jcsteh committed Aug 6, 2015
1 parent 6130cb6 commit 3868bc6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/appModules/explorer.py
Expand Up @@ -227,9 +227,17 @@ def event_NVDAObject_init(self, obj):
obj.presentationType=obj.presType_layout

def event_gainFocus(self, obj, nextHandler):
if obj.windowClassName == "ToolbarWindow32" and obj.role == controlTypes.ROLE_MENUITEM and obj.parent.role == controlTypes.ROLE_MENUBAR and eventHandler.isPendingEvents("gainFocus"):
wClass = obj.windowClassName
if wClass == "ToolbarWindow32" and obj.role == controlTypes.ROLE_MENUITEM and obj.parent.role == controlTypes.ROLE_MENUBAR and eventHandler.isPendingEvents("gainFocus"):
# When exiting a menu, Explorer fires focus on the top level menu item before it returns to the previous focus.
# Unfortunately, this focus event always occurs in a subsequent cycle, so the event limiter doesn't eliminate it.
# Therefore, if there is a pending focus event, don't bother handling this event.
return

if wClass == "ForegroundStaging":
# #5116: The Windows 10 Task View fires foreground/focus on this weird invisible window before and after it appears.
# This causes NVDA to report "unknown", so ignore it.
# We can't do this using shouldAllowIAccessibleFocusEvent because this isn't checked for foreground.
return

nextHandler()

0 comments on commit 3868bc6

Please sign in to comment.