Skip to content

Commit c43cf6c

Browse files
seanbuddactions-usercary-rowenbramd
authored
Beta to master (#20837)
Co-authored-by: GitHub Actions <actions@github.com> Co-authored-by: wencong <manchen_0528@outlook.com> Co-authored-by: Bram Duvigneau <bram@bramd.nl>
2 parents dd2bccb + d2cc936 commit c43cf6c

9 files changed

Lines changed: 5514 additions & 5476 deletions

File tree

‎extras/controllerClient/readme.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NVDA Controller Client API 2.0 Documentation
1+
# NVDA Controller Client API 3.0 Documentation
22

33
## Introduction
44

‎projectDocs/dev/createDevEnvironment.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ If you aren't sure, run `git submodule update` after every git pull, merge or ch
9797
* [Nullsoft Install System](https://nsis.sourceforge.io), version 3.11
9898
* [Java Access Bridge 64 bit, from Zulu Community OpenJDK build 17.0.16+8 Zulu (17.60.17)](https://github.com/nvaccess/javaAccessBridge32-bin)
9999
* [Windows Implementation Library (WIL)](https://github.com/microsoft/wil/), commit `7cf41936c5b4ab79daf0d9437211380dc69fa958`
100-
* [cppjieba - Chinese word segmentation](https://github.com/yanyiwu/cppjieba), commit `9408c1d08facc6e324dc90260e8cb20ecceebf70`
100+
* [cppjieba - Chinese word segmentation](https://github.com/yanyiwu/cppjieba), commit `b3602bef7d1f67521a61788a74fb5801a0e62cd3`
101101

102102
#### Build time dependencies
103103

‎source/_magnifier/config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def getFilter() -> Filter:
128128

129129
def setFilter(filter: Filter) -> None:
130130
"""
131-
Set filter from settings.
131+
Set filter from settings.
132132
133133
:param filter: The filter to set.
134134
"""

‎source/_magnifier/fullscreenMagnifier.py‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,29 @@
77
Full-screen magnifier module.
88
"""
99

10-
from ctypes import byref # noqa: I001
10+
from ctypes import byref
1111
from ctypes.wintypes import RECT
1212
from typing import override
1313

14-
from logHandler import log
15-
import ui
1614
import systemUtils
15+
import ui
16+
from logHandler import log
17+
from utils.debounce import PREVENT_THREE_HZ_FLASH_MS, debounceLimiter
1718
from winBindings import magnification
19+
20+
from .config import _isDebug, getFullscreenMode, isTrueCentered
1821
from .magnifier import Magnifier
22+
from .utils.errorHandling import MagnifierStartError, trackNativeMagnifierErrors
1923
from .utils.filterHandler import FilterMatrix
2024
from .utils.spotlightManager import SpotlightManager
2125
from .utils.types import (
26+
Coordinates,
2227
Filter,
23-
MagnifiedView,
2428
FullScreenMode,
25-
Size,
29+
MagnifiedView,
2630
MagnifierParameters,
27-
Coordinates,
31+
Size,
2832
)
29-
from .config import getFullscreenMode, isTrueCentered, _isDebug
30-
from .utils.errorHandling import trackNativeMagnifierErrors, MagnifierStartError
3133

3234

3335
class FullScreenMagnifier(Magnifier):
@@ -251,6 +253,10 @@ def _getFilterMatrix(self) -> FilterMatrix:
251253
case Filter.INVERTED:
252254
return FilterMatrix.INVERTED
253255

256+
@debounceLimiter(
257+
cooldownTimeMs=PREVENT_THREE_HZ_FLASH_MS,
258+
delayTimeMs=PREVENT_THREE_HZ_FLASH_MS,
259+
)
254260
@trackNativeMagnifierErrors
255261
def _applyFilter(self) -> None:
256262
"""

‎source/setup.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]:
331331
"mdx_truly_sane_lists",
332332
"mdx_gh_links",
333333
"pymdownx",
334+
# The compiled winrt projection modules import this at C level, where
335+
# modulefinder cannot see it, so bleak raises ModuleNotFoundError as soon as
336+
# a Bluetooth Low Energy device is discovered.
337+
"winrt.windows.foundation.collections",
334338
],
335339
"includes": [
336340
"nvdaBuiltin",

‎source/utils/debounce.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@
33
# This file may be used under the terms of the GNU General Public License, version 2 or later, as modified by the NVDA license.
44
# For full terms and any additional permissions, see the NVDA license file: https://github.com/nvaccess/nvda/blob/master/copying.txt
55

6-
from collections.abc import Callable # noqa: I001
6+
from collections.abc import Callable
77
from dataclasses import dataclass, field
88
from functools import wraps
99
from time import monotonic
10-
from typing import Any, ParamSpec
10+
from typing import Any, Final, ParamSpec
1111
from weakref import WeakKeyDictionary
1212

1313
import wx
1414

15-
1615
P = ParamSpec("P")
1716

17+
PREVENT_THREE_HZ_FLASH_MS: Final[int] = 200
18+
"""
19+
Ensure we don't apply visual changes more than 3 times per second to avoid triggering seizures.
20+
WCAG Three Flashes rule.
21+
"""
22+
1823

1924
@dataclass
2025
class _DebounceState:
@@ -42,6 +47,7 @@ def _executeDelayedCall(func: Callable[..., Any], state: _DebounceState) -> None
4247
args = state.pendingArgs
4348
kwargs = state.pendingKwargs
4449
func(*args, **kwargs)
50+
state.lastCallTimeMs = monotonic() * 1000
4551
state.pendingArgs = ()
4652
state.pendingKwargs = {}
4753
state.pendingHandle = None

‎user_docs/en/changes.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ eSpeak NG has been updated with added support for Ligurian and Abkhaz.
125125
* Improved speech responsiveness in long text with mixed capitalization or many digits. (#20433, @codeofdusk)
126126
* Windows OCR can now be used while Screen Curtain or NVDA's built-in Magnifier is active on supported systems. (#19164, #20630, @cary-rowen)
127127
* Reduced the number of cross-process UI Automation calls when processing events, reporting focus changes, reporting objects under the mouse and rendering browse mode content, by caching more properties and batching focus property fetches. (#20608, @LeonarddeR)
128+
* Limit the speed of rapid Magnifier filter updates to reduce the risk of triggering seizures. (#20750)
128129

129130
### Bug Fixes
130131

@@ -218,6 +219,7 @@ Please refer to [the developer guide](https://download.nvaccess.org/documentatio
218219
* robotframework to 7.4.2. (#20707)
219220
* unittest-xml-reporting to 4.0.0. (#20707)
220221
* setuptools to 84.0.0. (#20744)
222+
* Updated the NVDA Controller Client API to 3.0, adding a `nvdaController_isSpeaking` function. (#20188)
221223
* The remote Python console, available when running NVDA from source, works again. (#20626, @LeonarddeR)
222224
* The UIA remote operations framework now supports cache requests. (#20621, @LeonarddeR)
223225
* A remote operation can create a cache request with `ra.newCacheRequest`, add properties and patterns to it, and populate the cache of a remote element with `RemoteElement.populateCache`.

0 commit comments

Comments
 (0)