Bug 449918 - plasma-workspace-5.24.0 sets Xft.dpi to 0 in Xresources
Summary: plasma-workspace-5.24.0 sets Xft.dpi to 0 in Xresources
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Startup process (show other bugs)
Version: 5.24.0
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-02-10 08:33 UTC by Guillaume Castagnino
Modified: 2022-02-15 00:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Castagnino 2022-02-10 08:33:04 UTC
SUMMARY
Since upgrade to plasma-workspace-5.24.0, my plasma X11 session opens with Xft.dpi: 0. This messes especially webkit-gtk applications (in my case, Evolution mail, but tested epiphany browser too).

I see there was change in this area, especially https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1012/diffs#96a3553f6e69e17f575e2ced2f36e16c755d5e6a_0_22

If I’m not mistaken, if fontDpiKey is present, it’s value is dumped to xrdb, even if it’s 0?
In my case, it’s present in configuration (forcing dpi is disabled in fonts kcm) and the value is 0 indeed in configuration file.

xrdb right after opening session:
$ xrdb -query
Xcursor.size:   24
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.dpi:        0
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb

kcm font config file:
$ cat .config/kcmfonts 
[General]
dontChangeAASettings=true
forceFontDPI=0


STEPS TO REPRODUCE
1. upgrade to plasma-wokspace-5.24.0
2. restart session
3. 

OBSERVED RESULT
Xft.dpi is set to 0

EXPECTED RESULT
Xft.dpi should not be set in my case (I have no scaling) just like it was before

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo linux
(available in About System)
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2022-02-11 18:48:16 UTC
Good catch, looks like that's exactly what happens. `fontsCfg.readEntry(fontDpiKey, 0)` means "fall back to 0 if fontDpiKey isn't found". And then that 0 gets unconditionally written out.

Would you like to submit a merge request to fix it?
Comment 2 David Edmundson 2022-02-14 23:16:17 UTC
>Good catch, looks like that's exactly what happens. `fontsCfg.readEntry(fontDpiKey, 0)` means "fall back to 0 if fontDpiKey isn't found". And then that 0 gets unconditionally written out.

Just above we have:

    if (!fontsCfg.hasKey(fontDpiKey)) {
        return;
    }

It means there is a key with this set to 0 set by someone.
So similar bug, but not the fault of my patch (obviously :D )
Comment 3 Bug Janitor Service 2022-02-14 23:20:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1457
Comment 4 Nate Graham 2022-02-15 00:39:05 UTC
Git commit 0bb681869f0462e74d0c411e2108bf3e0d371dd5 by Nate Graham, on behalf of David Edmundson.
Committed on 15/02/2022 at 00:38.
Pushed by ngraham into branch 'master'.

Move to runtime check of valid font DPI

The current code checks if we have an entry, but not that the entry is
sane.
FIXED-IN: 5.24.1

M  +3    -2    kcms/fonts/fontinit.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/0bb681869f0462e74d0c411e2108bf3e0d371dd5
Comment 5 Nate Graham 2022-02-15 00:39:42 UTC
Git commit 6c2d9d4a66db35ab208f194f6a37c7d0bc634d11 by Nate Graham, on behalf of David Edmundson.
Committed on 15/02/2022 at 00:39.
Pushed by ngraham into branch 'Plasma/5.24'.

Move to runtime check of valid font DPI

The current code checks if we have an entry, but not that the entry is
sane.
FIXED-IN: 5.24.1


(cherry picked from commit 0bb681869f0462e74d0c411e2108bf3e0d371dd5)

M  +3    -2    kcms/fonts/fontinit.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/6c2d9d4a66db35ab208f194f6a37c7d0bc634d11