mouse icon indicating copy to clipboard operation
mouse copied to clipboard

not DPI aware

Open snoyes opened this issue 3 years ago • 3 comments
trafficstars

Modern monitors may have a DPI much higher than 96, but unless an application tells Windows that it knows that, Windows assumes the application believes the DPI to be 96 and does some stretching . That means that you can have your resolution set to 1920x1080 and mouse.get_position() will still report the bottom right as (1535, 863).

The solution is ctypes.windll.shcore.SetProcessDpiAwareness(2). Users of this library could import ctypes and set this in the application code themselves, but it would probably be better to put it into _winmouse.py.

snoyes avatar Sep 02 '22 14:09 snoyes

Thanks for the information. However this seems to be a per-process setting, and doing it in a library might have adverse effects elsewhere. Do you know of any alternatives that are not based on global flags?

boppreh avatar Sep 02 '22 20:09 boppreh

I don't. Perhaps it would be sufficient to document the behavior and provide the solution for those users who care.

I'm curious if a difference in DPI is what produced issue #101

snoyes avatar Sep 03 '22 00:09 snoyes

I tried, but it didn't work.

AlanZookie avatar Dec 09 '22 08:12 AlanZookie