Summary: | Different scaling on HiDpi display for applications in 5.27.1 | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Michal Hlavac <miso> |
Component: | Startup process | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kde, luca.bacci, michael, nate, null, nyanpasu64, painless.roaster, parag.lkml, rdieter, slartibart70 |
Priority: | NOR | Keywords: | regression |
Version: | 5.27.1 | ||
Target Milestone: | 1.0 | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kde-gtk-config/commit/d2a84a92ca563b94fdfbea9d8edb8eb5955bccf0 | Version Fixed In: | 5.27.4 |
Sentry Crash Report: | |||
Attachments: |
Different scale for some applications
dpi issue Messed up desktop on Wayland |
The same problem is on Fedora 36 and 37 with Plasma 5.27.1. Changing DPI affects the desktop and main menu, but all applications remain running at dpi 96. Fedora Linux 36 with Plasma 5.27.1 here, and this seems to be the issue I'm experiencing... Everything is stuck at 96 DPI, and looks tiny on QHD at 27in. Global scale makes everything blurry, while forcing font DPI does nothing... except when xsettingsd randomly decides not to run on startup, turning the desktop into a mess. See also https://bugs.kde.org/show_bug.cgi?id=426788#c14 Hi everyone, thanks for the bug report! I'm going to open an MR to address this issue. If everything goes smoothly the fix will be available for KDE 5.27.3 Best, Luca Thanks Luca, would be really great to have it in 5.27.2, anyway maybe a kind of workaround for GTK3+ & java applications is to run: GDK_SCALE=2 program or echo "GDK_SCALE=2" >> ~/.profile this basically saves my work life. (In reply to Luca Bacci from comment #3) > Hi everyone, thanks for the bug report! I'm going to open an MR to address > this issue. If everything goes smoothly the fix will be available for KDE > 5.27.3 > > Best, > Luca Thank you for your helpful attitude. Please could this problem be resolved urgently and a patch published. The bug is blocking all users who have a high-dpi monitor. Created attachment 156821 [details]
dpi issue
I have attached a picture describing the problem.
I noticed that restarting kwin_x11 set the title bar DPI from override 120 to default 96, and running `killall kded5` caused my override DPI to apply again. I think that every time I restart plasma-kded.service, there's a random chance that 120 DPI applies (instantly to Firefox and Armcord), Armcord's font size grows and shrinks quickly, or nothing at all happens (remains at 96 DPI). Is there a race condition somewhere in kded5's code? A possibly relevant merge request was started @ https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/64 (In reply to Bug Janitor Service from comment #8) > A possibly relevant merge request was started @ > https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/64 It's not just a problem with gtk applications. DPI is not accepted even by native kde apps. (In reply to nyanpasu64 from comment #7) > I noticed that restarting kwin_x11 set the title bar DPI from override 120 > to default 96, and running `killall kded5` caused my override DPI to apply > again. > > I think that every time I restart plasma-kded.service, there's a random > chance that 120 DPI applies (instantly to Firefox and Armcord), Armcord's > font size grows and shrinks quickly, or nothing at all happens (remains at > 96 DPI). Is there a race condition somewhere in kded5's code? I confirm that killing the kded5 task temporarily solves the problem. (In reply to painless roaster from comment #9) > It's not just a problem with gtk applications. DPI is not accepted even by > native kde apps. Currently kde-gtk-config sets the xft/DPI XSetting which is read both by GTK and Qt applications, hence why the problem appears even outside of GTK applications (In reply to Bug Janitor Service from comment #8) > A possibly relevant merge request was started @ > https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/64 Well, that's really unexpected. On fedora, removing the kde-gtk-config package solves the problem of native kde applications. So it is indeed possible that the patch will help. Not sure what's going on... Is the "xft/DPI XSetting" the variable seen by `xrdb -query -all`? Observations: - `xrdb -query -all|grep Xft|sort` shows `Xft.dpi: 120` even with windows erroneously at 96dpi. - Running xsettingsd (not sure what it does) fixes DPI, even after Ctrl-C. Running again reverts to 96 DPI, but Ctrl-C reapplies font DPI. (In reply to nyanpasu64 from comment #13) > Not sure what's going on... Is the "xft/DPI XSetting" the variable seen by > `xrdb -query -all`? Observations: > > - `xrdb -query -all|grep Xft|sort` shows `Xft.dpi: 120` even with > windows erroneously at 96dpi. > - Running xsettingsd (not sure what it does) fixes DPI, even after Ctrl-C. > Running again reverts to 96 DPI, but Ctrl-C reapplies font DPI. That's a good point about xsettingsd. If the whole xsettingsd package is uninstalled, everything goes without a problem. :-) (In reply to Bug Janitor Service from comment #8) > A possibly relevant merge request was started @ > https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/64 I tried the patch and it didn't help. So far, uninstalling xsettingsd works best. *** Bug 466506 has been marked as a duplicate of this bug. *** Version 5.27.2 did not solve the problem. :-( (In reply to Michal Hlavac from comment #4) > Thanks Luca, would be really great to have it in 5.27.2, anyway maybe a kind > of workaround for GTK3+ & java applications is to run: > > GDK_SCALE=2 program > > or echo "GDK_SCALE=2" >> ~/.profile > > this basically saves my work life. The easiest workaround is to use settings->Startup and Shutdown->Background Services and disable GNOME/GTK Settings Synchronisation Service - fixes KDE and other app's (as noted in https://bugs.kde.org/show_bug.cgi?id=466506). (In reply to Nate Graham from comment #16) > *** Bug 466506 has been marked as a duplicate of this bug. *** In answer to the question from Bug 466506: > Can you try again with Plasma 5.27.2? We removed some unnecessary font size handling stuff in that bugfix release. Tumbleweed updated to 5.27.2 didn't help, it's the same as I described in Bug 466506. Disabling the GNOME/GTK Settings Synchronisations Service remains an easy workaround. Hi painless.roaster! Could you try again with https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/63? It's now finished and should work as is. Thanks! Created attachment 157004 [details]
Messed up desktop on Wayland
This looks like the same issue - hopefully will be addressed in .3 release - Plasma Wayland is unusable on 5.27.x - OpenSuSE Tumbleweed, 4k monitor, scaling set to 200%. Not just for GTK apps - the whole desktop and all KDE apps have wrong scale.
Works fine if I switch to X11 so seems to be Wayland specific.
(In reply to Luca Bacci from comment #20) > Hi painless.roaster! Could you try again with > https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/63? It's now > finished and should work as is. > > Thanks! I've tried the fix to build the kde-gtk-config package in Fedora 36 and 37. This solved the problem for both of them. Good work. Thank you! #63 Fixes the problem for me as well. *** Bug 467386 has been marked as a duplicate of this bug. *** Git commit 1b66b4b5fd6ccc8b5b938fcaaed78639360dfc47 by Fushan Wen, on behalf of Luca Bacci. Committed on 17/03/2023 at 16:51. Pushed by fusionfuture into branch 'master'. Beside monitor scaling factors, a user may specify a preferred text DPI size from the system configuration utility (KCM fonts) That setting is stored inside the kcmfonts configuration file; one entry is kept for Plasma/X11 sessions, "forceFontDPI", and another for Plasma/Wayland sessions, "forceFontDPIWayland". Here we make kde-gtk-config read such entries (depending on the Plasma session type) and then set the GTK text scaling settings accordingly. Fixes #3 Related: bug 461106 FIXED-IN: 5.27.4 M +2 -0 kded/config_editor/gsettings.cpp M +9 -1 kded/config_editor/xsettings.cpp M +1 -0 kded/config_editor/xsettings.h M +23 -0 kded/configvalueprovider.cpp M +5 -0 kded/configvalueprovider.h M +37 -12 kded/gtkconfig.cpp M +2 -0 kded/gtkconfig.h https://invent.kde.org/plasma/kde-gtk-config/commit/1b66b4b5fd6ccc8b5b938fcaaed78639360dfc47 Git commit d2a84a92ca563b94fdfbea9d8edb8eb5955bccf0 by Fushan Wen, on behalf of Luca Bacci. Committed on 17/03/2023 at 17:04. Pushed by fusionfuture into branch 'Plasma/5.27'. Beside monitor scaling factors, a user may specify a preferred text DPI size from the system configuration utility (KCM fonts) That setting is stored inside the kcmfonts configuration file; one entry is kept for Plasma/X11 sessions, "forceFontDPI", and another for Plasma/Wayland sessions, "forceFontDPIWayland". Here we make kde-gtk-config read such entries (depending on the Plasma session type) and then set the GTK text scaling settings accordingly. Fixes #3 Related: bug 461106 FIXED-IN: 5.27.4 (cherry picked from commit 1b66b4b5fd6ccc8b5b938fcaaed78639360dfc47) M +2 -0 kded/config_editor/gsettings.cpp M +9 -1 kded/config_editor/xsettings.cpp M +1 -0 kded/config_editor/xsettings.h M +23 -0 kded/configvalueprovider.cpp M +5 -0 kded/configvalueprovider.h M +37 -12 kded/gtkconfig.cpp M +2 -0 kded/gtkconfig.h https://invent.kde.org/plasma/kde-gtk-config/commit/d2a84a92ca563b94fdfbea9d8edb8eb5955bccf0 After upgrading to framework 5.105 all GTK application runs with dpi 96. Plasma: 5.27.4 Framework: 5.105 Qt: 5.15.8 Kernel: 6.2.9 Hello, Michal! Is it on a Wayland session or X11 session? Can you post the output of: dump_xsettings ps aux | grep -iE 'xsettings|kded' Also, what scaling settings do you have in System Settings > Display and Monitor Thank you, Luca Hi Luca, I run primary on X11. But I tried Wayland and there it looks like all Plasma and also GTK applications runs with DPI 96. ================================================================================ X11 output: hlavki@hlknb:~> dump_xsettings Gdk/UnscaledDPI 98304 Gdk/WindowScalingFactor 1 Gtk/ButtonImages 1 Gtk/CursorThemeName "breeze_cursors" Gtk/CursorThemeSize 36 Gtk/DecorationLayout "icon:minimize,maximize,close" Gtk/EnableAnimations 1 Gtk/FontName "Noto Sans, 8" Gtk/MenuImages 1 Gtk/PrimaryButtonWarpsSlider 0 Gtk/ToolbarStyle 3 Net/IconThemeName "Papirus" Net/ThemeName "Breeze" hlavki@hlknb:~> ps aux | grep -iE 'xsettings|kded' hlavki 22696 1.3 0.4 2202624 154352 ? Ssl 22:22 0:01 /usr/bin/kded5 hlavki 22794 0.0 0.0 7656 4480 ? S 22:22 0:00 /usr/bin/xsettingsd hlavki 25977 0.0 0.0 6528 2304 pts/1 S+ 22:24 0:00 grep --color=auto -iE xsettings|kded Global Scale: 100% ================================================================================ Wayland output: Gdk/UnscaledDPI 98304 Gdk/WindowScalingFactor 1 Gtk/ButtonImages 1 Gtk/CursorThemeName "breeze_cursors" Gtk/CursorThemeSize 36 Gtk/DecorationLayout "icon:minimize,maximize,close" Gtk/EnableAnimations 1 Gtk/FontName "Noto Sans, 8" Gtk/MenuImages 1 Gtk/PrimaryButtonWarpsSlider 0 Gtk/ToolbarStyle 3 Net/IconThemeName "Papirus" Net/ThemeName "Breeze" hlavki 26573 0.8 0.4 2273276 149968 ? Ssl 22:25 0:00 /usr/bin/kded5 hlavki 26627 0.0 0.0 7668 4224 ? S 22:25 0:00 /usr/bin/xsettingsd hlavki 28704 0.0 0.0 6528 2304 pts/2 S+ 22:27 0:00 grep --color=auto -iE xsettings|kded Global Scale: 100% Ok, things look good there. Can you also have a look in System Settings > Appearance > Fonts > Force Font DPI. Is that set to 96 DPI or some other value? Luca Force DPI is off. https://paste.opensuse.org/pastes/462da4efefda Alright! May I ask how did you set the DPI value for Qt / Plasma applications? Sorry, the cause of my problem was file ~/.Xresources with Xft.dpi: 192 When I removed it, it works as expected. thanks |
Created attachment 156754 [details] Different scale for some applications SUMMARY *** Using OpenSUSE Tumbleweed X11 with plasma 5.27.1 and fonts for QT applications has different dpi, e.g. menu has correct dpi, but kmail, or ksettings has wrong dpi. Also for GTK applications I must use GDK_SCALE=2 to scale correctly. In wayland scaling unified, but also wrong. It looks like it uses dpi 96, so everything is small. *** STEPS TO REPRODUCE 1. Login to plasma using 4K monitor. 2. Try some applications 3. OBSERVED RESULT see screenshot EXPECTED RESULT Unified scaling. SOFTWARE/OS VERSIONS Linux/KDE Plasma: openSUSE Tumbleweed (20230224) (available in About System) KDE Plasma Version: 5.27.1 KDE Frameworks Version: 5.103.0 Qt Version: 5.15.8+kde160 ADDITIONAL INFORMATION Screenshot in attachment.