Selective UIA event handling#11214
Conversation
|
@LeonarddeR I can confirm that the latest try build fixes my issues under Windows 7. |
|
Hi, Regarding emoji panel and other modern input features, the fundamental issue to consider is focus change. A few months ago I tried to resolve overlay focus issues by faking a focus change event when emoji panel opens, but this resulted in NVDA's notion of "focus" being trapped once the panel was closed i.e. previously focused window isn't announced once the panel closes. In theory, this issue would also impact touch keyboard support on Windows 8 and later if it also suffers from focus trap issue, along with a possible impact on UIA notification event handling for classic Edge. I'm looking into resolving emoji panel issue from the app module side and to test this PR at the same time. Thanks. |
josephsl
left a comment
There was a problem hiding this comment.
It turns out focus change handler will add or remove events every time focus changes. This is more so when moving focus to a different element inside the same foreground window/application. This might be something to optimize later.
Apart from modern input support not working well, this looks promising. Thanks.
|
Hi, Found a way to restore emoji panel support - local event group must be added for input panel header. This means this PR must block #10378 - I'll package that PR and the follow-up one together. Thanks. |
|
Found a bug:
Expected: auto-read continues functioning after this, with no need to switch windows. |
|
@josephsl wrote:
This is currently intentional. #8742 implemented per foreground event registration, but as @jcsteh noted in #8742 (comment) , it wouldn't fix property event bombarding within the same foreground window. @codeofdusk wrote:
This is really weird. It looks like the local event registration isn't triggered when focus is back on the terminal window. I will investigate this. |
|
Hi, I see. By the way, for modern input, one must first remove local events before adding local event handler group, otherwise event groups will get large, leading to NVDA announcing things multiple times. This must be done for item selected and window open event – the former for emoji panel, the latter for dictation and hardware keyboard input, respectively. Thanks.
|
|
Ugh, so UIA allows you to register one handler to elements multiple
times? That's horrific!
I think we need something like eventHandler.requestEvents for UIA. If
I'm correct, for modern input, we only need the name change anyway.
|
|
Hi, yes for emoji panel, item selected event may be needed for hardware keyboard input. Eventually we need to do something about clipboard history context menu, but that’s beyond this PR. Thanks.
|
|
item selected event is listened to globally, as it is also required for
search results.
|
|
@codeofdusk It looks like the issue with the UIA implementation of cmd is exactly the same issue as that requires us to implement focusRedirect. I will investigate a fix. |
|
More generally, I'd think you'd want to find a method of dealing with focus changes through redirects... |
|
I will investigate whether it is possible to hide stuff behind a feature flag, so the initial version of this pull request can hopefully be merged sooner, with may be some issues remaining. |
This comment has been minimized.
This comment has been minimized.
|
Hi, By the way, in order to properly test this, one must:
Open Python console, then: The import statement is not needed if UIA handler was already imported. Thanks. |
|
Hi, My results so far:
Scenarios tested:
For hardware keyboard suggestions and emoji panel, one workaround is manually registering various UIA events for modern input apps. This does allow hardware keyboard suggestions to be announced and emoji categories to be heard when pressing Tab from emoji panel in 1809 and later. Thanks. |
|
Hi, Another thing to consider: in Windows 10's Start menu, after selecting a search result or moving focus away from the screen itself, suggestions closed sound is not heard (this is the case with at least 20H2). This is caused by the fact that when a search result is selected, focused item isn't search box anymore (search box is responsible for raising UIA controller for event). I'm designing a potential fix from my end. Thanks. |
|
@josephsl What specific UIA events are required for hardware keyboard and emoji selection support that was broken with this pr? |
|
Hi, “window open” and “item selected”. Thanks.
|
|
Personally, I think we shouldn't make these issues block this pr from going through, as the new behavior isn't the default. Also, in 2004 it works fine for me, at least when pressing escape to close the start menu. |
|
Hi, that I can confirm that. I think for now it would be preferable to let people test this for a long time and come up with edge cases as time goes. Thanks.
|
|
Yep, I agree.
The more the testing cases from master,the more the possiblility for fixing issues.
|
|
How is situation with this? |
|
i've been using this for the last month or so on a Windows 10 machine in production, as Visual Studio is almost unbearable without it. |
|
I am really for merging this,
It really proves the performance boost
|
|
Hi, or rather, gives us plenty of time to test edge cases and come up with proper workarounds and could serve as a stepping stone for a bigger things. I second early merge. Thanks.
|
|
I will look into reviewing / merging this on Monday.
|
|
This feature has been disabled by default for several releases. At this stage, what is blocking enabling by default? |
Link to issue number: Partial mitigation for #11002. Follow-up of #11214 and #13297. Summary of the issue: NVDA 2020.3 introduced support for selective registration for UIA events based on the currently-focused provider, but this is disabled by default due to bugs in the Windows 10 task manager and emoji panel. These bugs have been fixed in Windows 11 SV2. Description of how this pull request fixes the issue: By default, enable selective UIA event registration on Windows 11 Sun Valley 2 (22H2). Testing strategy: Enable by default in master snapshots to allow for wider testing.
Link to issue number:
Closes #11209
fixes #11077
Improves #11002
Follow up of #8742
Summary of the issue:
NVDA is listening globally to many UIA elements. This causes a major performance hit when many events are received (#11109)
Description of how this pull request fixes the issue:
Testing performed:
Known issues with pull request:
Change log entry: