fix magnifier follow modes bug#19992
Conversation
|
In #19990, I was suggesting to add another tracker, namely "Follow system cursor". I have not yet tested this PR, but it seems that it's not the solution you have chosen. Can you clarify here how the magnified view reacts or doesn't react to system cursor moves (or browse mode cursor), depending on the various trackers ("Follow X" options)? |
|
@Boumtchack - can we please focus on the existing PRs you have open? It would be really valuable for the project to finish all the started work before taking on new tasks. |
|
Understood - happy to reopen. |
|
should this be marked as ready for review? |
|
Current behavior is: System caret / browse mode cursor movement is handled by Follow system focus (it reads caret position first, then falls back to focused object location). |
|
Also, if no follow option is selected, the magnifier will not move, since “Toggle all” now behaves as “disable all / restore previously enabled options.” |
|
Adding a dedicated “Follow system cursor” tracker could still be useful to give users finer control by separating caret/browse-cursor tracking from general system-focus tracking, but it would also introduce an additional setting and gesture, which may increase complexity. |
Yes, that would be nice. That's exactly what I do in my Windows Magnifier add-on. Though, testing tis PR (commit defffcc), the toggle all still behaves as a true all/off toggle... Could you double check?
No, unless someone request it in the future; in this case this will be discussed in a separate issue.
OK. In any case, this PR is a fix for what had already validated and merged. In case we want to add a specific option for system cursor tracking, let's discuss it in a dedicated separate issue later. |
it should be working like this: If all options are enabled and you press "Toggle All", all get disabled. Pressing again re-enables all of them. This looks like a true on/off toggle, but it's just because all were enabled to begin with, this is likely what you observed during testing. can you tell me again how you tested it ? |
|
h> > Yes, that would be nice. That's exactly what I do in my Windows Magnifier add-on. Though, testing tis PR (commit defffcc), the toggle all still behaves as a true all/off toggle... Could you double check?
I have just re-tested (on commit 109c196) and all is working as expected, i.e. as you describe. Sorry for inconvenience, I had probably tested badly the first time. |
There was a problem hiding this comment.
Pull request overview
Fixes regressions in NVDA magnifier “follow modes” behavior so toggling follow settings no longer causes unexpected view movement, and disabling all follow modes properly freezes the view until a followed source actually changes.
Changes:
- Add “last reported” coordinate tracking in
FocusManagerto preserve/freeze the magnifier position when no enabled follow source produces a new event. - Update “toggle all follow settings” semantics to a true disable-all → restore-previous flow.
- Adjust magnifier follow-mode unit tests to cover freeze/restore behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
source/_magnifier/utils/focusManager.py |
Tracks last reported coordinates and returns them when no eligible follow update occurs (prevents jumps on toggles / all-disabled freeze). |
source/_magnifier/config.py |
Changes toggleAllFollowStates to disable all first, then restore saved states on next toggle. |
source/_magnifier/commands.py |
Removes forced immediate focus refresh when toggling follow settings; updates “toggle all” messaging. |
tests/unit/test_magnifier/test_focusManager.py |
Adds/updates tests to validate freeze behavior when follow modes are disabled or toggled. |
|
does this close the issues mentioned in the PR description? If so, make sure to prefix each issue number with "fixes" |
Link to issue number:
fixes #19991
fixes #19990
Summary of the issue:
The magnifier follow-mode behavior was inconsistent: disabling follow modes could still cause view movement, toggling follow settings could trigger an immediate jump, and “Toggle all follow settings” did not provide the expected disable/restore flow.
Description of user facing changes:
The magnifier view now remains stable when follow modes are toggled, stays frozen when all follow modes are disabled, and “Toggle all follow settings” now works as a true two-step action: disable all first, then restore the previous follow configuration.
Description of developer facing changes:
Focus tracking logic in the magnifier now preserves and reuses the last reported coordinates when no enabled follow source produces a new event, and follow-setting toggle commands no longer force an immediate focus refresh. The all-follow toggle state handling was updated to implement disable-all and restore semantics.
Description of development approach:
The fix was implemented by adjusting the focus source resolution flow to avoid fallback-driven movement, removing forced update calls from follow toggle commands, and aligning global follow-toggle state transitions with the intended UX behavior (disable all -> restore previous states).
Testing strategy:
manual
Known issues with pull request:
Code Review Checklist: