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

Highlighting frames are misplaced on the secondary display with another DPI scaling #13370

Closed
VeselovAlex opened this issue Feb 21, 2022 · 0 comments · Fixed by #13254
Closed
Labels
audience/low-vision PR or issue is relevant to sighted or low vision users displayScaling Display scaling and DPI awareness triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@VeselovAlex
Copy link
Contributor

Steps to reproduce:

You need two displays with different DPI scaling factors (e.g. 100% and 200%)

  1. Start NVDA and enable highlighting
  2. Open explorer.exe, pick some item and make sure it is highlighted
  3. Move the window to another display - the blue rectangle is now at the wrong position

Actual behavior:

image

Expected behavior:

image

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

2021.2

Windows version:

Windows 11

Name and version of other software in use when reproducing the issue:

Other information about your system:

Screenshots were taken on screen with 175% and 200% scaling

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

@seanbudd seanbudd added the triaged Has been triaged, issue is waiting for implementation. label Feb 28, 2022
@feerrenrut feerrenrut removed the triaged Has been triaged, issue is waiting for implementation. label Feb 28, 2022
@seanbudd seanbudd added the triaged Has been triaged, issue is waiting for implementation. label Feb 28, 2022
@seanbudd seanbudd added displayScaling Display scaling and DPI awareness audience/low-vision PR or issue is relevant to sighted or low vision users labels Aug 23, 2022
seanbudd pushed a commit that referenced this issue Aug 30, 2022
Fixes #13370
Fixes #6722
Fixes #3875
Fixes #12070
Fixes #7083
Fixes #7915
Likely fixes #9531, otherwise close as stale/can't reproduce

### Summary of the issue:
When DPI for a monitor is not set to 100%, or when using multiple monitors with different DPI settings,
NVDA would:

- misplace highlight frames
- have inaccurate mouse tracking
- have inaccurate touch screen interaction

NVDA currently sets the DPI awareness via a Windows API call introduced in Windows Vista.
It is recommended to set DPI through the app manifest, rather than Windows API calls where possible.

Newer settings for DPI awareness have been introduced since Windows Vista.
Windows 8 introduced multiple monitor DPI awareness.
Windows 10 introduced a richer version of multiple monitor DPI awareness.

### Description of how this pull request fixes the issue:
Background docs: https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows#per-monitor-and-per-monitor-v2-dpi-awareness

When running as an executable, NVDA sets DPI awareness via the app manifest.
When running through source, NVDA sets DPI awareness via Windows API calls.
The most modern method available is used to set DPI awareness.

- For Windows 7, DPI awareness is unlikely to improve. There may be fixes from setting it via the app manifest instead of via Windows API calls.
- For Windows 8 and newer, NVDA has per monitor DPI awareness
- For Windows 10 1703 and newer, NVDA has [advanced per monitor DPI awareness](https://docs.microsoft.com/en-us/windows/win32/hidpi/dpi-awareness-context), including:
  - Child window DPI change notifications
  - Scaling of non-client area - All windows will automatically have their non-client area drawn in a DPI sensitive fashion. Calls to [EnableNonClientDpiScaling](https://docs.microsoft.com/en-us/windows/desktop/api/Winuser/nf-winuser-enablenonclientdpiscaling) are unnecessary.
  - Scaling of Win32 menus - All NTUSER menus created in Per Monitor v2 contexts will be scaling in a per-monitor fashion.
  - Dialog Scaling - Win32 dialogs created in Per Monitor v2 contexts will automatically respond to DPI changes.
  - Improved scaling of comctl32 controls - Various comctl32 controls have improved DPI scaling behavior in Per Monitor v2 contexts.
  - Improved theming behavior - UxTheme handles opened in the context of a Per Monitor v2 window will operate in terms of the DPI associated with that window.
@nvaccessAuto nvaccessAuto modified the milestone: 2022.4 Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audience/low-vision PR or issue is relevant to sighted or low vision users displayScaling Display scaling and DPI awareness triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants