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

Focus tracker incorrect when screen resolution is not 100% #7065

Closed
minorninth opened this issue Apr 11, 2017 · 11 comments
Closed

Focus tracker incorrect when screen resolution is not 100% #7065

minorninth opened this issue Apr 11, 2017 · 11 comments

Comments

@minorninth
Copy link

To repro:

  1. Install the Focus Tracker add-on
  2. Set the display resolution to 200%

The focus highlight rectangle is often drawn incorrectly. I believe that apps are reporting true pixels in get_accLocation, but the add-on is drawing unscaled (virtual) pixels.

Aside from this the Focus Tracker add-on is really awesome, I'd love to see it incorporated directly into NVDA for developers and for users with low vision.

@nishimotz
Copy link
Contributor

I am working on supporting multiple displays and HiDPI environment.
Please help the development of focusHighlight.
Experimental version is as follows.

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

Actually I am still not sure how DPI-awareness should be handled inside the NVDA, though I have been working on latest Windows APIs regarding this.

@jcsteh
Copy link
Contributor

jcsteh commented Apr 11, 2017 via email

@nishimotz
Copy link
Contributor

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

It now uses GDI Plus and physical coordinates are used for drawing rectangles.
However, it is not enough for Per-monitor DPI awareness support.
NVDA core should be updated as well.
Is it correct? Should I make pull request as follows?

diff --git a/source/core.py b/source/core.py
index 6c7fd202f..3b5977c90 100644
--- a/source/core.py
+++ b/source/core.py
@@ -164,10 +164,15 @@ This initializes all modules such as audio, IAccessible, keyboard, mouse, and GU
        log.debug("Core starting")

        try:
-               # Windows >= Vista
-               ctypes.windll.user32.SetProcessDPIAware()
-       except AttributeError:
-               pass
+               # Windows >= 8.1
+               # PROCESS_PER_MONITOR_DPI_AWARE = 2
+               ctypes.windll.shcore.SetProcessDpiAwareness(2)
+       except WindowsError:
+               try:
+                       # Windows >= Vista
+                       ctypes.windll.user32.SetProcessDPIAware()
+               except AttributeError:
+                       pass

        import config
        if not globalVars.appArgs.configPath:

@josephsl
Copy link
Collaborator

josephsl commented Nov 5, 2017 via email

@nishimotz
Copy link
Contributor

@josephsl So, it is too late for 2017.4, right? How about for 2018.1?

@josephsl
Copy link
Collaborator

josephsl commented Nov 6, 2017 via email

@nishimotz
Copy link
Contributor

Just found PROCESS_PER_MONITOR_DPI_AWARE discussions regarding mouse tracking issue at #6722

@Adriani90
Copy link
Collaborator

highlighting and focus tracking are now actually part of NVDA 2019.3.1.
@minorninth are you still seeing this issue?

@Adriani90
Copy link
Collaborator

@nishimotz how are your plans with the focus highlight addon? Are you still maintaining it? I guess since this feature is part of NVDA now, this addon is not needed anymore. Is it correct?

@nishimotz
Copy link
Contributor

Currently, my add-on is being used by people who need the old versions of NVDA.
People who want to customize the color and style of the highlights are also using my add-on, but I expect that these features will be implemented on the NVDA side eventually.
I will continue to do only the essential maintenance for this add-on.

@Adriani90
Copy link
Collaborator

Thanks for the reporting. I am closing this issue now and if the initial author still wants to have it in your addon, he or she can create an issue on the coresponding repo. Thanks.

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

5 participants