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

Prepare for selective UIA event registration by default #13297

Merged
merged 12 commits into from
Aug 16, 2022

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Feb 1, 2022

Link to issue number:

None

Summary of the issue:

We would like to switch to selective UIA event registration by default.

Description of how this pull request fixes the issue:

Convert the selective UIA registration option to a ternary setting and factor out logic to determine whether to register selectively into a new function.

Testing strategy:

N/A

Known issues with pull request:

None known

Change log entries:

Not user-facing

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@codeofdusk codeofdusk requested a review from a team as a code owner February 1, 2022 19:02
@LeonarddeR
Copy link
Collaborator

There is a known issue that task manager is misbehaving when selective registration is on. I guess we'll have to take that for ok or fix it somehow.

@seanbudd
Copy link
Member

seanbudd commented Feb 9, 2022

@LeonarddeR - you are referring to #11599, correct?

I searched NVDA issues for "selective registration"

@codeofdusk - do you mind investigating how this PR effects #11599, #11354, #11109, #8624?

It looks like this will improve the latter two, but make behaviour worse for the first two.

@josephsl
Copy link
Collaborator

josephsl commented Feb 9, 2022 via email

@seanbudd
Copy link
Member

seanbudd commented Feb 9, 2022

Hi, note that enabling selective UIA event registration will break Windows 10 emoji panel support (does not affect Windows 11) due to the fact that emoji panel interface is an overlay that does not take system focus at all. Thanks.

@codeofdusk - merging this is definitely blocked by the above, and if a fix for #11599 is possible.

I suggest we try and find a mechanism to disable this for the Windows 10 emoji panel.
If we can disable this on an appModule level, the same could be done for task manager (and Firefox, if it is still necessary).

Another path is to create a third state for the setting, "Windows 11 only" which only enables this on Windows 11.
We can probably suppress the Task Manager verbosity depending on if the setting is enabled or disabled.

@seanbudd seanbudd marked this pull request as draft February 18, 2022 05:36
@codeofdusk
Copy link
Contributor Author

Another path is to create a third state for the setting, "Windows 11 only" which only enables this on Windows 11.

@seanbudd This would require a config spec schema upgrade. If we can fix #11599 I think that could be reasonable.

@codeofdusk
Copy link
Contributor Author

Actually, it looks like I can no longer reproduce #11599 at least on Nickel. I'll proceed with the config spec upgrade.

@LeonarddeR
Copy link
Collaborator

Can we use the new feature flag approach while at it?

@codeofdusk
Copy link
Contributor Author

Can we use the new feature flag approach while at it?

I'm not sure. This seems closer to the "diff algorithm" or "Windows Console support" option (choice of two approaches or an "automatic" option that lets NVDA decide based on runtime environment) than an opt-in/opt-out feature with set NVDA developer default.

@codeofdusk codeofdusk force-pushed the selective-uia-by-default branch 6 times, most recently from df5c845 to 7ce1e20 Compare July 20, 2022 08:33
@codeofdusk codeofdusk changed the title Selectively register for UIA events by default Selectively register for UIA events by default on Windows 11 Jul 20, 2022
@AppVeyorBot
Copy link

See test results for failed build of commit f2926f5ac2

@codeofdusk codeofdusk marked this pull request as ready for review July 20, 2022 09:15
@codeofdusk codeofdusk requested a review from a team as a code owner July 20, 2022 09:15
Copy link
Member

@Qchristensen Qchristensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User Guide change looks good

@seanbudd seanbudd added merge-early Merge Early in a developer cycle blocked/needs-code-review and removed blocked labels Jul 21, 2022
@seanbudd seanbudd added this to the 2022.4 milestone Jul 25, 2022
@codeofdusk

This comment was marked as outdated.

@seanbudd
Copy link
Member

@codeofdusk can you update the PR description? it appears out of date

@codeofdusk
Copy link
Contributor Author

@seanbudd What do you mean? It looks up-to-date to me.

source/config/profileUpgradeSteps.py Outdated Show resolved Hide resolved
Comment on lines 105 to 107
"""
Selective UIA registration check box has been replaced with event registration multi choice.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does profile['UIA']['eventRegistration'] become as the result of upgrading when:

  • the user has not changed the default value of profile['UIA']['selectiveEventRegistration'] (e.g. it is set to False)
  • the user has explicitly set the value to False

I currently only understand the case where:

  • the user has explicitly set the value to True

Could you add a summary of what happens for the 3 cases to the docstring?

@seanbudd
Copy link
Member

@codeofdusk the summary of the issue reads as if the bugs are still an issue. Can you add that these bugs are fixed in Windows 11 SV2?

@@ -101,7 +101,7 @@ def upgradeConfigFrom_5_to_6(profile: dict):
profile['UIA']['allowInMSWord'] = AllowUiaInMSWord.ALWAYS.value


def upgradeConfigFrom_6_to_7(profile: dict):
def upgradeConfigFrom_6_to_7(profile: Dict[str, str]) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, this change prevents NVDA from starting on my system.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to import Dict from typing

@codeofdusk
Copy link
Contributor Author

codeofdusk commented Aug 16, 2022

@seanbudd For some reason, adding your type hints to the config upgrade step seems to prevent NVDA from starting on my machine.

@@ -1,6 +1,6 @@
# -*- coding: UTF-8 -*-
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2016 NV Access Limited
#Copyright (C) 2016–2022 NV Access Limited, Bill Dengler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix linting you will probably have to add a space after the # for each line

Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codeofdusk LGTM once these minor things get fixed!

@codeofdusk
Copy link
Contributor Author

@seanbudd Do you think it's alright to keep the config spec upgrade and behaviour change in one PR, and in the event of revert follow the process outlined in the known issues? Or should I separate them similar to UIA console?

@seanbudd
Copy link
Member

@codeofdusk - that would be ideal, but I believe there is less risk of reverting for this PR

@codeofdusk codeofdusk changed the title Selectively register for UIA events by default on SV2 Prepare for selective UIA event registration by default Aug 16, 2022
@codeofdusk
Copy link
Contributor Author

@seanbudd Done. I'll make a follow-up once this is merged.

@AppVeyorBot
Copy link

See test results for failed build of commit 5caf543b4c

@seanbudd seanbudd merged commit f47dd5c into nvaccess:master Aug 16, 2022
@codeofdusk
Copy link
Contributor Author

Thanks @seanbudd. I've opened #14018.

seanbudd pushed a commit that referenced this pull request Aug 16, 2022
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.
seanbudd pushed a commit that referenced this pull request Sep 6, 2022
…in the selective registration UI, for consistency with the config spec (#14107)

Follow-up of #13297.

Summary of the issue:
In the advanced settings panel, the config options were referred to as "selectively" and "globally", but the config spec uses "selective" and "global", which makes more sense ("selective registration" vs "selectively registration").

Description of how this pull request fixes the issue:
Update the UI. No other functional changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-code-review merge-early Merge Early in a developer cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants