wslg: WSLg does not seem to support fractional scaling
Environment
Microsoft Windows [Version 10.0.21364.1]
kali-linux 2021.1
1.0.17.1]
Steps to reproduce
Set display scaling to 150%. Open a graphical application on that monitor (or move it to that monitor).
Expected behavior
The application scales according to the windows display scaling settings.
Actual behavior
wslg only seems to support 100% and 200% as display scales.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 70
- Comments: 67 (9 by maintainers)
Sorry, I should have put more clearly, please create a file named .wslgconfig at c:\ProgramData\Microsoft\WSL (or /mnt/c/ProgramData/Microsoft/WSL/.wslgconfig from Linux) with contents of below, and restart WSL with wsl --shutdown or wsl --terminate [distro name].
[system-distro-env] WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false
Any hope that Windows scaling 150% -> wsl 200% will be implemented any time? with option, for example… because WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false gives very blurry fonts
Any updates? This is still going from the start of WSLG, and no one ever thinks about fixing this problem at all? Having good quality for graphical desktop inside WSL should be mandatory when you are releasing a product like that, not optional.
Hi folks, we’ve made an update in the latest version of WSLg that is available with WSL in the Microsoft Store to change the behaviour where 150% Windows scaling will now go up to 200% WSLg scaling. Please try it out and give us any feedback that you have!
@abannachGrafana Thank you, you saved my night. I changed only: WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100
and added to bashrc: export GDK_SCALE=2.5
Thats all, no thick borders and caption, looks very nice. Thank you
All due respect @sandain I believe we are trying to solve the opposite problem. The default experience used to be 150% => 100%, which makes thing too hard to read, so in the latest build they are trying to switch the default to 150% => 200%. Now you are complaining that it’s too big haha. I guess we will simply need to wait until non-blurry fractional become a thing.
This conversation (about WSLg) has got muddied with discussion about GWSL, which is a completely separate project. They are vagualy linked by being graphics systems for WSL but that’s it.
Hi! As far as I can see, wp-fractional-scale-v1 support is already released in KDE 5.27 LTS https://invent.kde.org/plasma/kwin/-/merge_requests/2598 https://kde.org/announcements/changelogs/plasma/5/5.26.5-5.27.0/. I’ve tested KDE 5.27 in ubuntu 22.10 using backports and in fedora 37 and the scaling works perfectly. Is there any chance we can get that support in WSLg soon? I understand that de facto standard protocols may remain in staging for years.
It seems that this issue has been solved officially now. The fractional scaling is now supported by setting
export GDK_DPI_SCALE=1.5
or other fractions. I am using Windows 11 with WSL version: 1.2.5.0, WSLg version: 1.0.51.@hideyukn88 Since the wp-fractional-scale-v1 got supported in Gnome Mutter and in KDE Plasma.
https://wayland.app/protocols/fractional-scale-v1
And since it was merged into wayland’s main 5 months already, I think WSLg should support it as soon as possible.
I’ll chip in that from following the bouncing ball here, I was able to get my IntelliJ IDEA to scale, but the image is pixelated (not terrible, but noticeable).
System info:
C:/users/<username>/.wslgconfig
Scaled:
Unscaled:
It looks like fractional scaling doesn’t actually work. I found that setting WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=150 either does nothing, or gets rounded to 200%. WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100 gives me the 100% scaling that I expect (without the blurry fonts the WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING options does). Of course I would rather have 150% scaling, but I’ll take 100% over 200% any day.
PR #53 should be reverted since it doesn’t fix the real problem, and makes things arguable worse.
Is there already a plan when fractional scaling is supported? Almost all new monitors are 4K or more and some text scaling in Windows is very common.
@Laess3r, thanks for being patient on this issue, I think HI-DPI is a bit more complicated in Linux GUI space since its solution is largely dependent on each application framework, such as GTK and Qt, rather than window manager or UI compositor. Thus, legacy framework such as Xt/Motif has no support for that, and often those applications won’t be scaled at all on most of native Linux desktop, while WSLg does the best effort to scale them (but with limitation of scaling quality). For fractional scaling, even Ubuntu Desktop 20.04 LTS does not enable fractional scaling by default. Also, for newer Wayland, its output scaling protocol is still integer base. We will need more time to evaluate the solution, thanks!
It seems that if I am at 150% then the Linux app automatically goes to 100%, I want the opposite. Is there any way workaround to have a 150% and obtain a 200% result on the Linux apps?
i has find the reason for this strange behavior, for .wslgconfig, you need to add “;” at beginning of black line, otherwise configuration line after black line doesn’t take effect. Here comes my latest .wslconfig and /mnt/wslg/weston.log but if i set WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=150 or 125, the font is blurry, so i have to change back to WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100
@khuongduybui: It seems the goal should be 150%=>150% or 125%=>125%. Rounding up or down is not ideal. At least with rounding down, as it was, it is easy to increase font sizes. With rounding up by default, window decorations take up a ridiculous amount of screen real estate, and I don’t know an easy way to work around that on the Linux end of things.
Requiring the use of a poorly documented debugging option (that doesn’t actually give you what you ask for) to work around your “fix” (#53) is the opposite of user friendly.
it doesn’t work
Hi, I tried the solution provided above, but seems
WESTON_RDP_FRACTIONAL_HI_DPI_SCALING=true
is not taking any effect. I am setting up new laptop on Win11 with WSLg so I got wsl2, Ubuntu update to the lastest version. After went through this thread, I have my .wslconfig like below:The entry
memory=8GB
is taking effective, but all WESTON related entries are not.I got my
/mnt/wslg/weston.log
I can see the debug level is still 3 disrepecting I have put 5 in the configuration file. All other high DPI scaling related setting were ignored as well.My I know if any recent changed broke it or I have miss-configured anything. Thank you.
With both
.wslconfig
options turned off, there is this strange behavior.On a 4K monitor - Firefox / Chrome have proper scaling and they look good, even the mouse cursor
But gtk 3 apps such as gedit are double the size and the mouse cursor is huge
Maybe this reporting helps, thanks, wslg is awesome!
I did two .wslgconfig file location and it doesn’t apply at all, but this solution only works. What should I do?
I would recommend implementing “unstable” and “staging” protocol. That only means that new major versions may be added, nothing more. Breaking changes are still forbidden for a given major version.
@nkrepo, thanks for pointing out that, and I’m aware of that and it’s still in “staging”. Currently we only consume “stable” protocols, thanks!
@craigloewen-msft I will appreciate if you do something about this problem. this is so annoying
try
However, this results in ugly pixelated scaling rather than blurry. This is probably why it’s disabled by default
@eggcaker Add
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=100
toc:\Users\[your user name]\.wslgconfig
is any hack way to make the gui app smaller for this moment? after set
WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false
still looks very big , even the mouse cursor is very big tooI am also having this issue on my surface go 2 at 150% scale. I attempted to use WESTON_RDP_DISABLE_FRACTIONAL_HI_DPI_SCALING=false under [wsl2] in my WSL config file and it did not work. I did restart wsl.