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

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

Open
DustinVenegas opened this issue Feb 5, 2018 · 10 comments
Labels
font Relating to font options or rendering help wanted

Comments

@DustinVenegas
Copy link

DustinVenegas commented Feb 5, 2018

System Information

  • Operating System: Windows
  • Build from Source: No
  • Binary Version: Version 0.2.2 from Chocolatey. Looking at the nvim-qt.exe properties lists the Date Modified as 2017-11-18 14:39. The File Properties dialog doesn't include an actual version due to Include version/build number in nvim-qt.exe #255.

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
Copy link
Owner

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.

@DustinVenegas DustinVenegas changed the title Requires Windows - Additional scaling settings required with a multi-monitor setup Feb 8, 2018
@Zyst
Copy link

Zyst commented Apr 23, 2018

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
Copy link

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
Copy link
Owner

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?).

@equalsraf equalsraf added help wanted font Relating to font options or rendering labels Jul 25, 2018
@youngmit
Copy link

youngmit commented Sep 7, 2018

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

equalsraf pushed a commit that referenced this issue Sep 10, 2018
From the Qt docs, this should be the same as setting
QT_AUTO_SCREEN_SCALE_FACTOR, which #391 reports as fixing hidpi
multimonitor in Windows.

The Qt attribute AA_EnableHighDpiScaling was only added in Qt 5.6 so
this patch has no effect when using earlier versions.
@equalsraf
Copy link
Owner

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

@youngmit
Copy link

@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
Copy link
Owner

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
Copy link

@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
Copy link
Owner

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.

equalsraf pushed a commit that referenced this issue Sep 10, 2018
For now I'm setting this in windows only, there open
issues in upstream Qt that suggests this may have unexpected effects
in other systems (QTBUG-65061, QTBUG-65102), also QTBUG-63580 offers
contradictory information with what we have experienced.

The other way to do this is to set Qt::AA_EnableHighDpiScaling
but it does not seem to work on Windows. But it seems this does not
work on windows (#391).
equalsraf pushed a commit that referenced this issue Sep 11, 2018
For now I'm setting this in windows only, there open
issues in upstream Qt that suggests this may have unexpected effects
in other systems (QTBUG-65061, QTBUG-65102), also QTBUG-63580 offers
contradictory information with what we have experienced.

The other way to do this is to set Qt::AA_EnableHighDpiScaling
but it does not seem to work on Windows. But it seems this does not
work on windows (#391).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
font Relating to font options or rendering help wanted
Projects
None yet
Development

No branches or pull requests

5 participants