Comments (6)
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.
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
- 1920x1080, scaled to 125%
- 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.
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.
This issue might be explained by this SO post: https://stackoverflow.com/a/44422362
from screeninfo.
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.
Fix by @benshep is available on master and on PyPI as 0.6.3.
from screeninfo.
Related Issues (20)
- `is_primary` boolean for Monitor objects HOT 2
- conda package for screeninfo HOT 1
- get_monitors returns empty on osx when Enumerator not explicitly provided HOT 1
- WSL
- `y` for a secondary monitor has a different meaning in darwin vs other systems
- customdisplayprofiles current-path not work HOT 2
- Exception: Xinerama is not active HOT 3
- save width and height to a variable HOT 4
- Exception on Raspberry Pi 4 HOT 1
- Ubuntu 22.04: No enumerators available HOT 3
- No enumerations available: Ubuntu 22.04 on X11 HOT 1
- possible GDI Object leak on Windows HOT 3
- Problem with dearpygui
- Add screen diagonal line in inches as an attribute
- Get refresh rate HOT 2
- "No enumerators available" when running in SERVER
- Pull specific values from Monitor X
- Getting No Enumerators Available error when running on pygbag
- No monitor physical dimensions on MacOS HOT 3
- Installation error with conda and python 3.12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screeninfo.