Giter VIP home page Giter VIP logo

Comments (6)

benshep avatar benshep commented on June 3, 2024 1

The SO post gave the answer. To get screeninfo to report the resolutions correctly, I had to do

import ctypes
ctypes.windll.shcore.SetProcessDpiAwareness(2)

before querying get_monitors. When I did, the output was the expected:

[Monitor(x=0, y=0, width=1920, height=1080, width_mm=309, height_mm=173, name='\\\\.\\DISPLAY1'), 
 Monitor(x=1920, y=0, width=1920, height=1080, width_mm=510, height_mm=287, name='\\\\.\\DISPLAY2')]

Thanks a lot! I'll leave it up to you whether you close the issue or not - I have an effective workaround so I'm happy, but I don't know whether you want to put it into screeninfo somewhere (I guess it might have unintended consequences for others).

from screeninfo.

benshep avatar benshep commented on June 3, 2024

An update on this. I was using an old version of screeninfo that didn't have the DPI aware stuff. I updated it and it still doesn't quite work as I want.

My monitors are

  1. 1920x1080, scaled to 125%
  2. 1920x1080, scaled to 100%

They are side-by-side i.e. [1][2].

The newest version of screeninfo returns

[Monitor(x=0, y=0, width=1920, height=1080, width_mm=309, height_mm=173, name='\\\\.\\DISPLAY1'), 
 Monitor(x=2400, y=0, width=2400, height=1350, width_mm=510, height_mm=287, name='\\\\.\\DISPLAY2')]

So monitor 2 is getting scaled up - I don't think this is right. (My use case: producing a large wallpaper image that goes across both monitors. Currently it looks correct on monitor 2 but it doesn't scale correctly on monitor 1.)

from screeninfo.

hhannine avatar hhannine commented on June 3, 2024

Do I read your output correctly that after updating you're getting a too large resolution on the larger of the 2 of your displays, which is using 100% scaling? Quite peculiar if so.

Edit: Furthermore its offset suggests it's to the right of the smaller display but its offset x is 2400 which leaves a large gap between x=1920 and 2400. So both the resolution and position are reported incorrectly.

from screeninfo.

hhannine avatar hhannine commented on June 3, 2024

This issue might be explained by this SO post: https://stackoverflow.com/a/44422362

from screeninfo.

hhannine avatar hhannine commented on June 3, 2024

I'd like to see this resolved permanently in the package itself since the true resolution is the intended and expected output. It would seem that the solution is different for W7&older than on Win8+ which is a bit shame.

Since you've got the hardware to test the implementation, would you mind writing a patch that replaces the current SetProcessDPIAware call on Win8 and Win10 machines with your solution?

from screeninfo.

rr- avatar rr- commented on June 3, 2024

Fix by @benshep is available on master and on PyPI as 0.6.3.

from screeninfo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.