When changing the scaling value, it only gets applied to Qt based apps. I have to export GDK_SCALE and GDK_DPI_SCALE by myself, which is a bad user experience. While GDK_SCALE only supports integers, at least common use cases (2x, like in my case) would be covered.
This isn't part of kwin. Moving. Given it's a simple patch to kscreen kcm and startkde do you want to write it? (at least not for X, for wayland this "just works" already)
Created attachment 109398 [details] set GTK scaling env vars in startkde
Very nice! Mint submitting it with http://phabricator.kde.org/?
Git commit aba3d48c07fce03d9e23717fc24de06aad5c75d7 by David Edmundson, on behalf of Peter Eszlari. Committed on 16/12/2017 at 14:27. Pushed by davidedmundson into branch 'master'. Set GTK scaling env vars Reviewed-by: David Edmundson M +3 -0 startkde/startkde.cmake https://commits.kde.org/plasma-workspace/aba3d48c07fce03d9e23717fc24de06aad5c75d7
Created attachment 109479 [details] replace bc with awk As it turns out, OpenSuse Krypton (which provides KDE git snapshots) does not include bc(!) in the default system, so the attched patch replaces bc+echo with awk.
and what's to say they provide awk?
> and what's to say they provide awk? Because I tested it?! It seems to be the same with Arch: they have gawk in "Core" and bc only in "Extra": https://www.archlinux.org/packages/core/x86_64/gawk/ https://www.archlinux.org/packages/extra/x86_64/bc/
I never had 'bc' installed. On the other hand, 'awk' is needed by system scripts.
Git commit 6202fc258e0b4b3c730774a00bc2e1afd21b5a64 by David Edmundson, on behalf of Peter Eszlari. Committed on 10/01/2018 at 17:03. Pushed by davidedmundson into branch 'master'. Replace bc with awk M +1 -1 startkde/startkde.cmake https://commits.kde.org/plasma-workspace/6202fc258e0b4b3c730774a00bc2e1afd21b5a64
Thanks for following that up. Peter in future can you use our review process at http://phabricator.kde.org it makes life easier for us.
Peter, sadly this broke some people and had to be reverted in Bug 389523. Since GDK_SCALE only supports integers, perhaps we could only conditionally set GDK_SCALE and GDK_DPI_SCALE if $kdeglobals_kscreen_scalefactor is also an integer. What do you think?
*** Bug 397217 has been marked as a duplicate of this bug. ***
https://phabricator.kde.org/D14697
Not sure what the status of this is, but it seems this could already work. If initial config would be fixed. What happened for me is, that KDE already picked a proper scale. Perfect. So I had no need to manually configure it. However Gtk did not scale well and I had to manually set GDK_DPI_SCLAE=1.5. Later I tried to hook up a 2nd screen and played with the scaling settings and so actually wrote them (in the end just the defaults). On next restart I got huge Gtk apps, apparently 1.5 from the env var on top 1.5 from KDE(? or xrandr?). So I removed manually setting GDK_DPI_SCLAE, and everything was fine again as before, even without manually messing with GDK_DPI_SCLAE... So why wasn't it just correct right from the beginning? What changed, and apparently was missing before, is in kdeglobals: +[KScreen] +ScaleFactor=1.5 +ScreenScaleFactors=DP-0=1.5;DP-1=1.5;DP-2=1.5;DP-3=1.5;DP-4=1.5;DP-5=1.5;DP-6=1.5;DP-7=1.5; + So if whatever this does, KDE would do initially and write that config, then everything might be great right from the start (regarding Gtk scaling)? Ubuntu 18.04 with KDE 5.12.6 (I would say..)
Git commit 31e1a1a96ca2d03e4da1284d6e965b0877376570 by Nate Graham, on behalf of Peter Eszlari. Committed on 18/10/2018 at 22:43. Pushed by ngraham into branch 'master'. X11: set GDK_SCALE (try 2) Summary: BUG: 387849 Reviewers: davidedmundson, ngraham, #plasma, broulik Reviewed By: ngraham Subscribers: broulik, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D14697 M +5 -0 startkde/startkde.cmake https://commits.kde.org/plasma-workspace/31e1a1a96ca2d03e4da1284d6e965b0877376570
I admit, I'm not sure I understand what this patch fixes and also all this HIDPI scaling is highly confusing, but it looks strange... Why does it only care about scale factor of 2 and 3? GDK_DPI_SCLAE=1.5 worked just fine for me... Also why does scale factors of 2 and 3 result in a GDK_DPI_SCLAE=1/2 and 1/3 respectively? Generally what happens if I have a [KScreen] ScaleFactor=1.5? Or some other fraction? ... just wondering :)
See https://developer.gnome.org/gtk3/stable/gtk-x11.html This is the method that the GNOME devs recommend. GTK only officially supports integer scale factors, we only try to scale GTK apps when using an integer scale factor. The behavior is undefined and not guaranteed if we try to make them do fractional scaling.