Created attachment 165522 [details] kwin_175percent_scaling_1_dpi_172032.png SUMMARY When display scaling is set to 175%, kwin communicates scaling factor of 1 to Gtk apps and sets Gdk/UnscaledDPI in xsettingsd config to 172032. That results in properly sized text, but small widgets, as a result text doesn't fit into buttons, menus, dropdown selections, etc. It works much better I force scaling factor to 2 and set Gdk/UnscaledDpi to 86016 I believe that kwin should properly round fractional scaling factors instead of flooring it. See attached screenshots as example. STEPS TO REPRODUCE 1. Set display scaling to 175% 2. Open any Gtk3 app (e.g. Orca Slicer) OBSERVED RESULT Text doesn't fit widgets, since text is scaled, but widgets are not EXPECTED RESULT Text should fit widgets SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: Archlinux, plasma 5.27.10 (available in About System) KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.114.0 Qt Version: 5.15.12
Created attachment 165523 [details] kwin_175percent_scaling_2_dpi_86016.png
kwin doesn't really set the dpi and it ceils the scale factor for apps that don't support fractional scaling, I believe kde-gtk-config does it. Is this an xwayland or a wayland app?
(In reply to Vlad Zahorodnii from comment #2) > kwin doesn't really set the dpi and it ceils the scale factor for apps that > don't support fractional scaling, I believe kde-gtk-config does it. Is this > an xwayland or a wayland app? I checked Orca Slicer sources and looks like it forces X11 backend for GTK due to some issue with WxGTK: https://github.com/SoftFever/OrcaSlicer/blob/8b1b3355e6ebf97475474661dc0516663a85798c/src/OrcaSlicer.cpp#L890 So apparently the issue is with kde-gtk-config, for some reason it sets Gdk/WindowScalingFactor to 1 if display scaling is 175%. Let me move the bug to kde-gtk-config package
Hm, I can't find kde-gtk-config product. Any suggestions where it should be reported? It looks like kde-gtk-config floors scaling factor: https://github.com/KDE/kde-gtk-config/blob/master/kded/gtkconfig.cpp#L254
BTW, Prusa Slicer also forces X11 GDK backend, you can try flatpak with it to reproduce the issue. Once display scaling is set to 175%, Prusa Slicer UI is more cramped and icons are barely distinguishable.
Hmm, floor() is probably not appropriate here. It should at least round(), not floor(). But maybe we can also find some way to approximate a fractional scale factor even though GTK apps don't officially support this.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/104
Git commit 28b724674815ecb23c078a0d23e33ab64d0df69a by Nate Graham, on behalf of Vasily Khoruzhick. Committed on 20/02/2024 at 20:39. Pushed by ngraham into branch 'master'. Round x11GlobalScaleFactor instead of flooring it When display scaling is set to 175%, flooring scale factor down to 1 results in very cramped widgets. To the point when the text scaled by 1.75 doesn't fit the widgets. Properly round x11GlobalScaleFactor to avoid that. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Fixed-IN: 6.0 M +7 -2 kded/gtkconfig.cpp https://invent.kde.org/plasma/kde-gtk-config/-/commit/28b724674815ecb23c078a0d23e33ab64d0df69a
Git commit fab18c5b7c5fb1648aa027af031a8bf5fd090be0 by Nate Graham, on behalf of Vasily Khoruzhick. Committed on 20/02/2024 at 20:41. Pushed by ngraham into branch 'Plasma/6.0'. Round x11GlobalScaleFactor instead of flooring it When display scaling is set to 175%, flooring scale factor down to 1 results in very cramped widgets. To the point when the text scaled by 1.75 doesn't fit the widgets. Properly round x11GlobalScaleFactor to avoid that. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Fixed-IN: 6.0 (cherry picked from commit 28b724674815ecb23c078a0d23e33ab64d0df69a) M +7 -2 kded/gtkconfig.cpp https://invent.kde.org/plasma/kde-gtk-config/-/commit/fab18c5b7c5fb1648aa027af031a8bf5fd090be0
Git commit 6b3865a72baff3932fbe89ef0c44ff1b9bb4cd10 by Nate Graham, on behalf of Vasily Khoruzhick. Committed on 20/02/2024 at 20:41. Pushed by ngraham into branch 'Plasma/5.27'. Round x11GlobalScaleFactor instead of flooring it When display scaling is set to 175%, flooring scale factor down to 1 results in very cramped widgets. To the point when the text scaled by 1.75 doesn't fit the widgets. Properly round x11GlobalScaleFactor to avoid that. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Fixed-IN: 6.0 (cherry picked from commit 28b724674815ecb23c078a0d23e33ab64d0df69a) M +7 -2 kded/gtkconfig.cpp https://invent.kde.org/plasma/kde-gtk-config/-/commit/6b3865a72baff3932fbe89ef0c44ff1b9bb4cd10
Reopening, since MR was reverted
Any suggestions on how to proceed with the bug? MR got reverted because it breaks JB IDE that interprets GTK settings different from GTK, so basically the choice is either GTK apps look good at 175% or JB IDE looks good at 175%.
For the reference: https://youtrack.jetbrains.com/issue/IDEA-347172/Make-IDE-based-scaling-behave-more-like-GTK
My inclination would be to push the more correct fix and let JetBrains fix their own bug.
(In reply to Nate Graham from comment #14) > more correct fix Could you please elaborate on what it would be?
The one that was merged and then reverted after we found out that JetBrains IDEs are doing something odd.