Skip to content

Changed tracking from center to top left coordinates#20313

Open
Boumtchack wants to merge 1 commit into
nvaccess:betafrom
France-Travail:fix/MagnifierAlignment
Open

Changed tracking from center to top left coordinates#20313
Boumtchack wants to merge 1 commit into
nvaccess:betafrom
France-Travail:fix/MagnifierAlignment

Conversation

@Boumtchack

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #20196

Summary of the issue:

The focus manager would not take into account the width or height of the object and returned their center, this could lead to out of Magnified view magnifier focus

Description of user facing changes:

user will now see the top left of the object as first focus

Description of developer facing changes:

focus manager no longer calculate the center of the focused object

Description of development approach:

return raw top left value instead of calculating the center

Testing strategy:

manual

Known issues with pull request:

Had to rewrite a typo in settings dialog that was breaking setting changes

Code Review Checklist:

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

@Boumtchack Boumtchack marked this pull request as ready for review June 10, 2026 14:18
@Boumtchack Boumtchack requested a review from a team as a code owner June 10, 2026 14:18
@Boumtchack Boumtchack requested review from Copilot and seanbudd June 10, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CyrilleB79

Copy link
Copy Markdown
Contributor

I'v just given a try.

Currently, the top left corner of the focus is centered. This means that the focused object will remain in the bottom right quarter of the screen.

IMO, keeping a quite simple algo, we can be nearer to what Windows Magnifier does and minimize view movements if we do the following:

  • track top left corner of the focus (as you already do here)
  • position the magnified view so that the top left corner is almost at the top left corner of the view, e.g.:
    • focusTop = viewTop + margin
    • focusLeft = viewLeft + margin

You could use the same margins as the one used for "Border" tracking algo.

@Boumtchack

Boumtchack commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

yeah we could, my concern with that is that it not really centered anymore, or maybe, just a naming issue.
Like if I expect to see a checkbox at the center of my view and it get at the top left it's not center anymore.
Same if I have a long paragraph but only 3 lines of height, wouldn't it be weird to see it at the top left?

I'm don't know If what I said made sense

Maybe an algo to calculate the best position could be nice, but I would require more feedback on what it should do

@CyrilleB79

Copy link
Copy Markdown
Contributor

IMO it would be better if tracking mode could be configurable separately, per tracking type.

For reference in Windows Magnifier:

  • mouse pointer tracking can be configured "Centered on screen" or "within the edges of the screen"
  • text cursor tracking can be configured "Centered on screen" or "within the edges of the screen" (separately from mouse)
  • focus tracking algo is not configurable and seems what I have described above
  • There is nothing about Narrator cursor either; I do not know if it is controlled with text cursor tracking mode too.

I understand that we cannot separate all tracking modes. But separating:

  • mouse pointer tracking mode: configurable center/borders/relative)
  • text cursor tracking mode (including text caret, browse mode cursor and review cursor): configurable too (center/borders/relative)
  • focus tracking mode: not configurable, top left aligned with top left
  • nav object tracking mode: not configurable, top left aligned with top left

Maybe it's too complex to start with. But IMO, if we keep a signle tracking mode for now (center/borders/relative), it should apply to mouse cursor and text caret (including review), not to focus / nav object.
This should also appear clearly in UG if it's our choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants