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

HiDPI + windows #1225

Open
bethouxa opened this issue Jun 9, 2017 · 14 comments
Open

HiDPI + windows #1225

bethouxa opened this issue Jun 9, 2017 · 14 comments
Labels
enhancement This is a feature request, or an idea to enhancement a current feature gui Issue is related specifically to the GUI code (wxPython)

Comments

@bethouxa
Copy link

bethouxa commented Jun 9, 2017

Bug Report

Pyfa looks blurry when scaled up by the OS (on Windows). Especially visible on high DPI displays.

Pyfa looks like this when upscaled : image

Detailed steps to reproduce:

In the Windows control panel, go to "Display", and increase the value of the "Change the size of text, apps..." slider. Open Pyfa.
Disabling high DPI scaling by right clicking the executable -> compatibility -> checking "disable display scaling on high DPI settings" solves the issue at the cost of, well, upscaling.

Release or development git branch? Please note the release version or commit hash:

Release branch : commit #461f521

Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):

Windows 10

@blitzmann
Copy link
Collaborator

Yeah... unfortunately pyfa is one of those apps that don't play nicely with scaling. This is a limitation of the underlying toolkit, I believe. There's quite a few apps that still look funky when changing the scaling for the desktop (PyCharm, for example, which is the IDE pyfa is developed with, has blurriness), and pyfa is one of them. There may be a few things that can be done, but a quick Google search returns limited information. Further research into this is required. :)

@Ebag333
Copy link
Contributor

Ebag333 commented Jun 9, 2017

Unfortunately wxPython was never designed with DPI scaling in mind. DPI scaling just increases the ratio for the app, so if your app is setup so that it has the best resolution at a 1:1 ratio, then it'll look terrible at a 1:2 ratio.

Modern apps will use extremely high resolution fonts and images even at low resolutions, so you can scale it without losing any quality.

Not much to be done there, since we don't control the font or images.

If your issue is the same as Bart in #1183 then might be able to work around the DPI issue......

@VioletGiraffe
Copy link

VioletGiraffe commented Dec 16, 2018

Modern apps will use extremely high resolution fonts and images even at low resolutions

I don't think that's an accurate nor true description. The fonts, for example, are rendered to the required size. A GUI framework that is DPI-aware will just know that the required size is x1.75 for 175% scaling, it will render a properly sized bitmap that can be mapped to the screen pixel-perfect. A framework that's non-DPI-aware will render at x1 and then the OS will scale up this bitmap, producing blurriness.

Also, wxWidgets, and, by proxy, wxPython do seem to support HiDPI, even though not perfectly yet.

@blitzmann
Copy link
Collaborator

wxWidgets (supposedly) has better support for hidpi in windows in 3.1. Unfortunaltey, wxPython is built with 3.0. I've been pushing Robin here and there in getting a 3.1 version built so that we can try it out. HiDPI is already available in OS x and linux builds, but linux support iirc is still iffy.

@VioletGiraffe
Copy link

@blitzmann: I see, didn't catch that bit, sorry for nagging, then. And thanks for paying attention to this issue. The program is perfectly usable, of course, but smaller text does get hard to read due to not being as crisp as it's supposed to be.

@blitzmann
Copy link
Collaborator

No worries at all! It's a question that pops up every now and then, and it's something > definitely want to get fixed at some point once wxPython gets updated

@DarkFenX
Copy link
Member

Some extra info is in #1957 which i closed

@DarkFenX
Copy link
Member

Looks like wxpython 4.1.x/4.2.x may fix this:
https://discuss.wxpython.org/t/high-dpi-windows-and-wxwidgets-3-1-x/33061

Not just for windows, for linux too (it has lowres bitmaps, the rest looks alright already): wxWidgets/Phoenix#1327

@mkaito
Copy link

mkaito commented Aug 23, 2019

I wanted to chime in to say that pyfa is barely usable on Linux on my 4k panels. I've resorted to running the (blurry) windows version in a Windows VM for the time being.

It doesn't seem to care what my Xorg DPI is set to.

@DarkFenX
Copy link
Member

DarkFenX commented Aug 23, 2019

I am using pyfa on my Debian + Gnome + Xorg on 3840x2160 17" display. In display settings I have 200% scaling set, pyfa is properly scaled up. (200% because xorg doesn't support non-integer scaling, and for Gnome via Wayland non-integer scaling has been added as an experimental feature only in the latest release.)

That said, as mentioned in wxWidgets/Phoenix#1327, full hiDPI support in not in wxpython 4.0.6 yet, and even in 4.1.0 it will be WIP.

Please create separate issue, mentioning screen resolution, distribution you are using, display server (xorg or wayland), dpi/scaling factor, as well as wxpython version.

@mkaito
Copy link

mkaito commented Aug 23, 2019

Actually, the fact that it works for you in Gnome made me dig a little into what Gnome does under the hood. Setting server DPI doesn't work, but setting GDK_SCALE and GDP_DPI_SCALE does. It's not even blurry like on Windows.

For reference, I'm now running pyfa with GDK_SCALE=2 GDK_DPI_SCALE=0.5 pyfa. The first scales the UI elements up, while the second scales the text back a little, which seems to work out fine for my screens.

@DarkFenX
Copy link
Member

DarkFenX commented Nov 17, 2019

FYI i tried recently released wxpython 4.0.7 under windows - created hidpi branch, where I set DPI awareness flag for Windows in 10c12e3 (other platforms do not need it).

However, it turns out that wx.GetApp().GetTopWindow().GetContentScaleFactor() still returns 1.0 despite actual scaling being 2.0, so we will have to wait until wxpython 4.1.x release, where it will most likely be fixed.

@DarkFenX
Copy link
Member

4.1.0 was released yesterday. wx.GetApp().GetTopWindow().GetContentScaleFactor() returns 2.0 on windows for me, so i guess we could start doing some interface work

@DarkFenX DarkFenX changed the title Blurry look when upscaled by Windows HiDPI + windows Apr 25, 2020
@DarkFenX DarkFenX added enhancement This is a feature request, or an idea to enhancement a current feature gui Issue is related specifically to the GUI code (wxPython) labels Apr 25, 2020
@DarkFenX
Copy link
Member

I started some work in hidpi branch, and it worked here and there, but I am blocked by some issues: wxWidgets/Phoenix#1615 + issues listed in #2179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is a feature request, or an idea to enhancement a current feature gui Issue is related specifically to the GUI code (wxPython)
Projects
None yet
Development

No branches or pull requests

6 participants