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.
(In reply to Nate Graham from comment #16) > The one that was merged and then reverted after we found out that JetBrains > IDEs are doing something odd. So it's been 7 months, I don't see any activity in JetBrains IDE ticket [1] and I don't think that they have any interest in fixing it as long as the change was reverted. Is it time to fix it for GTK and let JetBrains fix it on their side? [1] https://youtrack.jetbrains.com/issue/IJPL-43538/Make-IDE-based-scaling-behave-more-like-GTK
Testing today's git master with PrusaSlicer, it looks fine to me at 175% scale, both text and widget sizing. Are there any other apps that exhibit issues I could test with?
(In reply to Nate Graham from comment #18) > Testing today's git master with PrusaSlicer, it looks fine to me at 175% > scale, both text and widget sizing. > > Are there any other apps that exhibit issues I could test with? I still see the issue with Prusa Slicer-2.8.1 and Orca Slicer 2.2.0
I can't reproduce the issue with those apps and 175% scaling on git master.
I'm still seeing the issue with 6.2.5. What commit in git master is supposed to fix the issue?
I don't know.
There is nothing else we can do here. It is known that some apps cannot scale themselves when the font DPI is bumped, please change the Display Configuration setting "Legacy applications (X11) - scaled by system" that will keep the font DPI at 96.
(In reply to David Edmundson from comment #23) > There is nothing else we can do here. Please see https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/104 It was reverted though beacase a non-GTK app interprets GTK settings differently. > It is known that some apps cannot scale themselves when the font DPI is > bumped, please change the Display Configuration setting "Legacy applications > (X11) - scaled by system" that will keep the font DPI at 96. It's not really a solution, but if you need to close the bug just for the sake of closing the bug, sure.