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

Selectively register for UIA events by default on SV2 #14018

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/UIAHandler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ctypes
import UIAHandler
import weakref
import winVersion
from functools import lru_cache
from logHandler import log
from .constants import WinConsoleAPILevel
Expand Down Expand Up @@ -355,4 +356,9 @@ def _getConhostAPILevel(hwnd: int) -> WinConsoleAPILevel:
def _shouldSelectivelyRegister() -> bool:
"Determines whether to register for UIA events selectively or globally."
setting = config.conf['UIA']['eventRegistration']
return setting == "selective"
if setting == "selective":
return True
elif setting == "global":
return False
else:
return winVersion.getWinVer() >= winVersion.WIN11_22H2
2 changes: 1 addition & 1 deletion source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@ def __init__(self, parent):
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA decide whether to register
# selectively or globally for UI Automation events.
_("Automatic (globally)"),
_("Automatic (prefer selectively)"),
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA register selectively for UI Automation events
# (i.e. not to request events for objects outside immediate focus).
Expand Down
2 changes: 1 addition & 1 deletion user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ This button is only enabled if NVDA is configured to enable loading custom code

This option changes how NVDA registers for events fired by the Microsoft UI Automation accessibility API.
The registration for UI Automation events and property changes combo box has three options:
- Automatic: Currently equivalent to "globally".
- Automatic: "selectively" on Windows 11 Sun Valley 2 (version 22H2) and later, "globally" otherwise.
- Selectively: NVDA will limit event registration to the system focus for most events.
If you suffer from performance issues in one or more applications, We recommend you to try this functionality to see whether performance improves.
However, on older versions of Windows, NVDA may have trouble tracking focus in some controls (such as the task manager and emoji panel).
Expand Down