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

Scaling issues with Windows 10 High-DPI Multi-Display Setup #87

Open
jbussmann opened this issue May 29, 2024 · 0 comments
Open

Scaling issues with Windows 10 High-DPI Multi-Display Setup #87

jbussmann opened this issue May 29, 2024 · 0 comments

Comments

@jbussmann
Copy link

My physical setup consists of two monitors: a Surface Pro set to the default DPI scaling of 200% and an external monitor without DPI scaling placed above the Surface. Depending on the activity I'm using two different configurations.

  • single monitor: only the external monitor
  • dual monitor: Surface as primary display, external monitor as secondary display

I'm using screeninfo to programmatically check which configuration is active and place a tkinter app in such a way that it always appears in the middle of the external monitor. Which is either the primary or secondary display.

The issue arises when using the dual monitor configuration. Here is a minimal example to test the behaviour:

import tkinter
# import screeninfo

root = tkinter.Tk()
# screeninfo.get_monitors()
root.geometry(f"{300}x{100}")

tkinter.mainloop()

It produces a window 600x200px in size with a 60px titlebar on the primary display. As this is the Surface with a DPI scaling of 200%, this ist exactly what I expect. When moving the window to the secondary display, it halves its size to 300x100px with a 30px titlebar. Again, as expected because all windows work like this.

When uncommenting the two lines related to screeninfo, the behaviour becomes wired. Now it produces a window 300x100px in size with a 60px titlebar on the primary display, which is half the expected size. When moving the window to the secondary display, it stays exactly the same and now has double the expected titlebar thickness. This is undesired because it produces an unreadably small window on the DPI scaled high DPI display and an unbearably large titlebar on the unscaled standard DPI display.

I have read #24, #26 as well as #29 and understand the motivation for adding this feature. However it seems that mixed DPI scalings cause issues as it appears that the unscaled pixelsize for the window and the primary display's DPI scaling for the titlebar is used, regardless of where the window is placed. I would really appreciate, if someone fixes this as in the current state screeninfo is unusable for me. I however tracked the addition of DPI awareness down to be0d70a. So v0.5 works for me, as it gives me the number of displays and their respective resolution. I don't care about anything other than the default DPI scaling behaviour.

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

1 participant