equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.85k stars 171 forks source link

Windows - Additional scaling settings required with a multi-monitor setup #391

Open DustinVenegas opened 6 years ago

DustinVenegas commented 6 years ago

System Information

Problem Description and Reproduction Steps

I am using multiple monitors on Windows 10. The primary monitor is set to scale 200% at 2880x1800 resolution. Two secondary monitors scale 100% at 1920x1080 resolution.

Starting and running nvim-qt.exe on the first (and primary) monitor works, as intended.

image

Running nvim-qt.exe on either of the secondary monitors, or moving the window from the first to either of the secondary monitors, introduces scaling artifacts.

image

The default installation, performed through Chocolatey, does not have any specific DPI scaling overrides specified in the File Properties dialogue.

image

Modifying the "Override high DPI scaling behavior. Scaling performed by:" setting, and setting it to "System (Enhanced)", appears to fix the issue.

image

Conclusion

The executable doesn't appear to set any specific DPI settings. It's my hope that QT offers an easy way to configure application-level scaling.

Is there a doc-page I should append this to?

equalsraf commented 6 years ago

Thanks for reporting this, please leave the issue open so people will see it on a search.

Going trough the Qt docs it seems we will need to do some changes to support hidpi http://doc.qt.io/qt-5/highdpi.html#migration-of-existing-applications some of the environment vars there might help too.

Zyst commented 6 years ago

Can also reproduce this issue. Indeed found it through google search.

nvim-qt_2018-04-22_19-59-41

nvim-qt_2018-04-22_19-59-54

0vercl0k commented 6 years ago

FWIW I am running into the same behavior but in an RDP scenario; I don't expect it to affect the solution but mentioning still :).

Cheers

equalsraf commented 6 years ago

I cannot test this since I dont have hidpi. If someone could test a bit with the Qt environment variables that would be great.

QT_AUTO_SCREEN_SCALE_FACTOR [boolean] enables automatic scaling, based on the pixel density of the monitor. This will not change the size of point sized fonts, since point is a physical unit of measure. Multiple screens may get different scale factors. QT_SCALE_FACTOR [numeric] defines a global scale factor for the whole application, including point sized fonts. QT_SCREEN_SCALE_FACTORS [list] specifies scale factors for each screen. This will not change the size of point sized fonts. This environment variable is mainly useful for debugging, or to work around monitors with wrong EDID information(Extended Display Identification Data).

the first one is likely the most interesting.

One thing which is not 100% clear from the screenshots is whether the text is being rendered too small or too big (i.e. is the size of everything else but the fonts is wrong?).

youngmit commented 6 years ago

Just tested with QT_AUTO_SCREEN_SCALE_FACTOR=1 and it resolved the issue for me. Much rejoicing!

equalsraf commented 6 years ago

I've pushed a patch in #459 that should have the same effect. @youngmit can you, or someone else, test this?

youngmit commented 6 years ago

@equalsraf I've never embarked upon building, let alone on windows, but I can give it a shot tonight when im on my own computer

equalsraf commented 6 years ago

No need to build from source, Appveyor provides us with builds for all PRs.

If you check #459, there is a show all checks button with links to appveyor. When inside you need to select the build you want and then Artifacts.

the direct link is https://ci.appveyor.com/project/equalsraf/neovim-qt/build/1632/job/gm4vsoysjlkqwi5q/artifacts neovim-qt.zip should have everything you need.

but I can give it a shot tonight when im on my own computer

or you can build from source anyway ^^

youngmit commented 6 years ago

@equalsraf Thanks for the link; just tested it out and it doesn't appear to work. I am testing on a laptop with a smallish 4K display and an external, larger 4K display. Noticeably different DPI. With your executable, if I don't set the QT_AUTO_SCREEN_SCALE_FACTOR=1, there is a lot of dead space between characters when the window is on the external display, but if it is on the laptop display it looks good. If i set the environment variable, things look right on both displays. Let me know if there is another build you want me to test.

equalsraf commented 6 years ago

Ok, thanks for checking.

That is really strange, maybe I'm missing something on the Qt docs. But all references I could find suggest the flag should work.