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

HiDPI support #6

Open
nishimotz opened this issue Apr 10, 2017 · 7 comments
Open

HiDPI support #6

nishimotz opened this issue Apr 10, 2017 · 7 comments

Comments

@nishimotz
Copy link
Member

HiDPI support which covers:

  • multiple monitors
  • per monitor DPI changes

This work is in progress and a lot of test code should be removed before release.

So far, tested with Windows 10 version 1607 and 1703 only.

@nishimotz
Copy link
Member Author

Windows 8.1 raises the error as follows

ERROR - eventHandler.executeEvent (15:55:58):
error executing event: gainFocus on <NVDAObjects.Dynamic_DialogIAccessibleWindowNVDAObject object at 0x04090EB0> with extra args of {}
Traceback (most recent call last):
  File "eventHandler.pyo", line 143, in executeEvent
  File "eventHandler.pyo", line 91, in __init__
  File "eventHandler.pyo", line 98, in next
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 665, in event_gainFocus
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 625, in getInfo
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 318, in objToRect
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 230, in getDpiInfo
  File "ctypes\__init__.pyo", line 375, in __getattr__
  File "ctypes\__init__.pyo", line 380, in __getitem__
AttributeError: function 'GetDpiForSystem' not found

@nishimotz
Copy link
Member Author

Should handle the exception on Windows 10 as follows

ERROR - unhandled exception (18:41:37):
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 315, in 'calling callback function'
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 540, in wndProc
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 442, in updateFocusLocation
  File "C:\Users\nishimotz\AppData\Roaming\nvda\addons\focusHighlight\globalPlugins\focusHighlight.py", line 389, in moveAndShowWindow
ArgumentError: argument 5: <type 'exceptions.OverflowError'>: long int too long to convert

@nishimotz
Copy link
Member Author

Known issue:

  • on Windows XP, desktop boundary is not correctly handled.

@nishimotz
Copy link
Member Author

Known issue:

  • since Windows 10 version 1703, it seems that focusHighlight rectangle is shown behind the start menu, so it is not visible when start menu is open.

@nishimotz
Copy link
Member Author

According to nvaccess/nvda#7065
NVDA object locations are always physical coordinates.

I wrote some experimental global plugin and found that unexpected behaviors are caused by
Win32 APIs such as SetWindowPos and MoveWindow.

My observation (with Windows 10 version 1703) indicates

  • for primary monitor, window position APIs are always physical coordinates.
  • for sub monitors, window position APIs takes modified coordinates, as below:

sub monitors' coordinates for window position APIs = (physical coordinates in the virtual desktop) * (primary monitor scale factor) / (target monitor scale factor)

I don't understand why this behavior occurs.
It may depend on the DPI awareness of NVDA process itself.

nishimotz added a commit that referenced this issue Apr 16, 2017
nishimotz added a commit that referenced this issue Apr 16, 2017
@nishimotz
Copy link
Member Author

finally, modified version of NVDA and new add-on, as follows, work nicely with Windows 10 per-monitor DPI environment.

nvda_2017.4jp-beta-171105x
https://ci.appveyor.com/project/TakuyaNishimoto/nvdajp/build/jpbeta-470/artifacts

focusHighlight 5.0-dev-171105
https://github.com/nvdajp/focusHighlight/releases/tag/5.0-dev-171105

@mrazzari
Copy link

Just a heads up in case this helps anyone else... I use your plugin heavily for presentations, where my HiDPI laptop is plugged into a VGA projector.

Either cloning the screen or extending it, the focus rectangle works for Windows apps, Window's settings, and for Firefox's browser's chrome (tabs, menus). But it fails for webpage content.

The issue can be worked around by disabling HiDPI just for NVDA.

Since NVDA is non-visual anyway (pun), this setting doesn't otherwise impact usage.

In Explorer or on the Start menu, right-click the NVDA access shortcut, select Properties, select the Compatibility tab, and then select the Disable display scaling on high DPI settings check box.

In Windows 10 Creators Update (Version 1703) and later version of Windows, this is under Override high DPI scaling behavior, then scaling performed by: Application.

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

No branches or pull requests

2 participants