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

"Auto" display scale on portrait vs landscape monitors is too large #48585

Closed
lewiji opened this issue May 9, 2021 · 1 comment · Fixed by #48597
Closed

"Auto" display scale on portrait vs landscape monitors is too large #48585

lewiji opened this issue May 9, 2021 · 1 comment · Fixed by #48597

Comments

@lewiji
Copy link
Contributor

lewiji commented May 9, 2021

Possibly related: #48226, godotengine/godot-proposals#2661

Godot version:
3.3 stable

OS/device including version:
Arch Linux, 5.11 kernel, KDE Plasma (global scaling off/100%). Nvidia proprietary drivers. I have 2 "2K" 2560x1440 monitors, the secondary of which is rotated 90 degrees to portrait orientation (I prefer editing code this way, more vertical space).

Issue description:
With interface/editor/display_scale set to "Auto" in the editor settings, if the Godot editor launches on my primary, landscape monitor, it correctly sets the display scale to 100%.

However, if it launches on my secondary (which can often happen by "accident" with various KDE settings and tiling window managers for example), it instead sets the UI scale to 150%, and this also causes the Godot window to stretch beyond the boundaries of my second monitor and "leak" into the first monitor.

It's a little tricky to see with screenshots alone, but here's the comparison (warning high res images and an eye-bleeding psychedelic wallpaper):

This is the editor, launched on the primary, landscape 2560x1440 monitor, then moved to secondary monitor for comparison, with the correctly applied 100% UI scale:

godot-100-on-portrait

And here is Godot launched on secondary portrait monitor, 1440x2560, incorrect 150% auto scale detected. In addition, the left edge of window cuts into the primary monitor (you can see the taskbar on the primary monitor floating above the Godot window for example - the taskbar ends at the right edge of the left screen. This is much clearer to see on the monitors themselves, so let me know if a photo would be helpful). Additionally, the Godot window width can't be shrunk any further and won't fit on the portrait screen at this scale.

godot-150-portrait

Actually the scaling doesn't look all that bad in the screenshot, but on the monitor itself (27") it's way too space consuming, and the edge "leaking" makes it unworkable.

Of course, this can entirely be fixed by manually setting the display scale to 100%, which is what I've done for a while now, but I just saw it happen again on a build with self contained config and thought to report it after searching the issues for relevant keywords :)

I haven't checked the editor code yet, but I suspect that it's looking to see if the monitor resolution height dimension is greater than a particular breakpoint to apply the relevant scaling. If that's the case, it should be checking the breakpoint against the smaller of the 2 dimensions (the smaller of either width or height) to get an accurate read.

@Calinou
Copy link
Member

Calinou commented May 9, 2021

Until godotengine/godot-proposals#2661 is implemented (which will take a while), we can fix this by picking the smallest screen dimension instead of only relying on the screen height.

My monitors can't rotate, but I'll try to fix this and stretch my neck for a good cause 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants