nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.11k stars 637 forks source link

Word (2016 at least) Documents opened in protected view often immediately lose focus #7540

Open Qchristensen opened 7 years ago

Qchristensen commented 7 years ago

When opening a document from the downloads folder or an e-mail attachment, Word opens it in Protected mode. Often (but not always), such documents open, but immediately lose focus. When the document opens, instead of identifying Microsoft Word, NVDA reads simply "Protected view".

Pressing the down arrow reads nothing (and does not move focus - pressing many times does not scroll screen either for instance).

Pressing alt twice to move focus to the ribbon and back gives the document focus and it can be read then. I have the "Open e-mail attachments and other uneditable files in reading view" option turned off (press alt+f, then t, then alt+o to toggle, then ENTER to close Word options).

Pressing NVDA+F1 while the document has lost focus shows the following log:

INFO - globalCommands.GlobalCommands.script_navigatorObject_devInfo (11:42:31.451):
Developer info for navigator object:
name: u'In process to publish.docx - Word'
role: ROLE_PANE
states: STATE_FOCUSABLE
isFocusable: True
hasFocus: False
Python object: <NVDAObjects.IAccessible.IAccessible object at 0x07064AB0>
Python class mro: (<class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: None
location: (0, -1, 2560, 1295)
value: None
appModule: <'appModuleHandler' (appName u'winword', process ID 5724) at address 7289f50>
appModule.productName: u'Microsoft Office 2016'
appModule.productVersion: u'16.0.8326.2076'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 197116
windowClassName: u'OpusApp'
windowControlID: 0
windowStyle: 399441920
windowThreadID: 844
windowText: u'In process to publish.docx - Word'
displayText: u'In process to publish.docx'
IAccessibleObject: <POINTER(IAccessible) ptr=0xd785400 at 7380d50>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=197116, objectID=-4, childID=0
IAccessible accName: u'In process to publish.docx - Word'
IAccessible accRole: ROLE_SYSTEM_CLIENT
IAccessible accState: STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048576)
IAccessible accDescription: None
IAccessible accValue: None
dkager commented 7 years ago

Confirmed. I also notice that using the arrow keys to navigate is more sluggish than when editing is enabled?

Adriani90 commented 4 years ago

@Qchristensen how is this now with NVDA 2020.1 and the last update of Office 2016 or 365? I canot really reproduce this issue.

Qchristensen commented 4 years ago

I can still reproduce this roughly 2/3 of the time in testing just now. Using NVDA 2020.1 and Office 365 (64-bit) Version: 16.0.12827.20258 Just trying to open the same document I saved from online repeatedly, it sometimes worked and sometimes didn't (the attached log includes one of each instance). When it happens, it only reports "Protected view" when Word opens. If you try to read, or move, nothing happens and the log records:

Input: kb(desktop):downArrow
DEBUG - IAccessibleHandler.accessibleObjectFromEvent (16:41:20.433) - MainThread (20948):
oleacc.AccessibleObjectFromEvent with window 331278, objectID 2 and childID 0: [WinError -2147467259] Unspecified error

Here is the developer information from NVDA+F1 at that point:

Input: kb(desktop):NVDA+f1
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IAccessibleRole (16:41:22.824) - MainThread (20948):
accRole failed: (-2147417848, 'The object invoked has disconnected from its clients.', (None, None, None, 0, None))
INFO - globalCommands.GlobalCommands.script_navigatorObject_devInfo (16:41:23.087) - MainThread (20948):
Developer info for navigator object:
name: None
role: ROLE_UNKNOWN
roleText: None
states: STATE_INVISIBLE
isFocusable: False
hasFocus: False
Python object: <NVDAObjects.IAccessible.IAccessible object at 0x03C7D0F0>
Python class mro: (<class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'object'>)
description: None
location: None
value: None
appModule: <'appModuleHandler' (appName 'winword', process ID 26912) at address 7351f30>
appModule.productName: 'Microsoft Office'
appModule.productVersion: '16.0.12827.20268'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 2493686
windowClassName: 'MsoSplash'
windowControlID: 0
windowStyle: 0
extendedWindowStyle: 0
windowThreadID: 32260
windowText: ''
displayText: exception: cannot unpack non-iterable NoneType object
IAccessibleObject: <POINTER(IAccessible) ptr=0x57a1e88 at 73f3c10>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=2493686, objectID=-4, childID=0
IAccessible accName: exception: (-2147417848, 'The object invoked has disconnected from its clients.', (None, None, None, 0, None))
IAccessible accRole: exception: (-2147417848, 'The object invoked has disconnected from its clients.', (None, None, None, 0, None))
IAccessible accState: exception: (-2147417848, 'The object invoked has disconnected from its clients.', (None, None, None, 0, None))
IAccessible accDescription: exception: (-2147417848, 'The object invoked has disconnected from its clients.', (None, None, None, 0, None))
IAccessible accValue: exception: (-2147417848, 'The object invoked has disconnected from its clients.', (None, None, None, 0, None))
DEBUG - IAccessibleHandler.accessibleObjectFromEvent (16:41:23.252) - MainThread (20948):
oleacc.AccessibleObjectFromEvent with window 593916, objectID 1 and childID 0: [WinError -2147467259] Unspecified error
DEBUG - IAccessibleHandler.accessibleObjectFromEvent (16:41:23.252) - MainThread (20948):
oleacc.AccessibleObjectFromEvent with window 593916, objectID 2 and childID 0: [WinError -2147467259] Unspecified error
DEBUG - IAccessibleHandler.accessibleObjectFromEvent (16:41:23.252) - MainThread (20948):
oleacc.AccessibleObjectFromEvent with window 593916, objectID 3 and childID 0: [WinError -2147467259] Unspecified error
DEBUG - IAccessibleHandler.accessibleObjectFromEvent (16:41:23.253) - MainThread (20948):
oleacc.AccessibleObjectFromEvent with window 593916, objectID 4 and childID 0: [WinError -2147467259] Unspecified error
DEBUG - IAccessibleHandler.accessibleObjectFromEvent (16:41:23.254) - MainThread (20948):
oleacc.AccessibleObjectFromEvent with window 593916, objectID 5 and childID 0: [WinError -2147467259] Unspecified error
IO - speech.speak (16:41:23.263) - MainThread (20948):
Speaking [LangChangeCommand ('en_GB'), 'NVDA Log Viewer']

nvda.log

Adriani90 commented 6 months ago

@Qchristensen testing with NVDA 2024.1 it seems this issue does not occur anymore on Windows 11 23 H2 and MS Office 365 last update. Can you reproduce with Office 365 or MS Office 2016? cc: @ehollig maybe you can test as well?