Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDAObjects/UIA: forcefully raise value change event for combo boxes that does expose value pattern yet does not raise the said event. re #6337 #7132

Merged
merged 4 commits into from Jun 23, 2017

Conversation

josephsl
Copy link
Collaborator

@josephsl josephsl commented May 3, 2017

Hi,

Resolves the following issue:

Suggested what's new entry (bug fix): NVDA will announce selection changes for certain Windows 10 combo boxes.

Thanks.

Fixes #6337

…that does expose value pattern yet does not raise the said event. re nvaccess#6337.

Some combo boxes does expose value pattern but does not raise value change event. To get around this, selection on its children (items) will be tracked (same trick as combo boxes with no value pattern).
michaelDCurran added a commit that referenced this pull request May 9, 2017
@jcsteh
Copy link
Contributor

jcsteh commented May 30, 2017

I think this is causing brokenness in some cases. STR:

  1. Open the Windows Store app.
  2. Tab to the Search box and enter a query. I entered: wolfram
  3. Press enter.

NVDA now says "list" and throws an unhandled exception. Pressing NVDA+tab to report the focus also throws an exception. Log fragment:

IO - speech.speak (17:01:33.454):
Speaking [u'list']
ERROR - eventHandler.executeEvent (17:01:33.457):
error executing event: gainFocus on <NVDAObjects.UIA.ComboBoxWithoutValuePattern object at 0x07BEDD10> with extra args of {}
Traceback (most recent call last):
  File "eventHandler.pyc", line 143, in executeEvent
  File "eventHandler.pyc", line 91, in __init__
  File "eventHandler.pyc", line 98, in next
  File "C:\Users\jamie\AppData\Roaming\nvda\addons\wintenApps\globalPlugins\wintenObjs\__init__.py", line 295, in event_gainFocus
  File "eventHandler.pyc", line 98, in next
  File "C:\Users\jamie\AppData\Roaming\nvda\addons\remote\globalPlugins\remoteClient\__init__.py", line 341, in event_gainFocus
  File "eventHandler.pyc", line 98, in next
  File "NVDAObjects\__init__.pyc", line 908, in event_gainFocus
  File "NVDAObjects\__init__.pyc", line 820, in reportFocus
  File "speech.pyc", line 354, in speakObject
  File "speech.pyc", line 270, in speakObjectProperties
  File "baseObject.pyc", line 34, in __get__
  File "baseObject.pyc", line 110, in _getPropertyViaCache
  File "NVDAObjects\UIA\__init__.pyc", line 1413, in _get_value
AttributeError: 'NoneType' object has no attribute 'GetCurrentSelection'
IO - inputCore.InputManager.executeGesture (17:01:34.625):
Input: kb(desktop):NVDA+f1
INFO - globalCommands.GlobalCommands.script_navigatorObject_devInfo (17:01:35.249):
Developer info for navigator object:
name: u'Type filter All types selected'
role: ROLE_COMBOBOX
states: STATE_FOCUSABLE, STATE_COLLAPSED, STATE_FOCUSED
isFocusable: True
hasFocus: True
Python object: <NVDAObjects.UIA.ComboBoxWithoutValuePattern object at 0x07BEDD10>
Python class mro: (<class 'NVDAObjects.UIA.ComboBoxWithoutValuePattern'>, <class 'NVDAObjects.UIA.UIA'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: u'Collapsed'
location: (89, 167, 403, 65)
value: exception: 'NoneType' object has no attribute 'GetCurrentSelection'
appModule: <'winstore_app' (appName u'winstore_app', process ID 11940) at address 7b207b0>
appModule.productName: u'Windows Store'
appModule.productVersion: u'11705.1000.118.0'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 2499228
windowClassName: u'Windows.UI.Core.CoreWindow'
windowControlID: 0
windowStyle: 1409286144
windowThreadID: 10800
windowText: u'Store'
displayText: u''
UIAElement: <POINTER(IUIAutomationElement) ptr=0xb00f748 at 7c003f0>
UIA automationID: _dropDownComboBoxmediaType
UIA frameworkID: XAML
UIA runtimeID: (42, 2499228, 3, 46)
UIA providerDescription: [pid:11940,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:Windows.UI.Xaml.dll)]
UIA className: GridViewItem

…#6337.

Caught by Jamie Teh (NV Access): when searching for items in store, the media type list is sometimes shown, and this may not have the required pattern at all. If this happens, Attribute Error is raised. When handling this, catch this error first, otherwise AttributeError will continue to be raised.
@josephsl
Copy link
Collaborator Author

Hi,
Confirmed and caught, some lists raise AttributeError. For this case, catch this one first in addition to COM Error. Fix just committed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UIA: Handle combo boxes with value pattern
4 participants