Bug 432930 - Synced font data not actually taking effect on login screen
Summary: Synced font data not actually taking effect on login screen
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_sddm (show other bugs)
Version: 5.20.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-14 11:31 UTC by popov895
Modified: 2021-03-31 19:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21.4


Attachments
SDDM log (11.54 KB, text/plain)
2021-02-14 11:31 UTC, popov895
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2021-02-14 11:31:09 UTC
Created attachment 135680 [details]
SDDM log

SUMMARY

I found that after syncing my settings (System Settings > Startup and Shutdown > Login Screen > Advanced > Sync), the login screen still uses the default font. The following commands show no difference:

    diff ~/.config/kdeglobals /var/lib/sddm/.config/kdeglobals
    diff ~/.config/plasmarc /var/lib/sddm/.config/plasmarc
    diff ~/.config/fontconfig/fonts.conf /var/lib/sddm/.config/fontconfig/fonts.conf

Some elements of the login screen applied the font from theme.conf.user (/usr/share/sddm/themes/breeze/theme.conf.user) after I changed it as follows:

    [General]
    type=image
    displayFont="Noto Sans"
    fontSize=12

Also the following command prints a bunch of messages like "Cannot read property 'xxx' of null" to the terminal (see attachment):

    sddm-greeter --test-mode --theme /usr/share/sddm/themes/breeze/

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: openSUSE Tumbleweed 20210130
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 1 popov895 2021-02-14 16:35:04 UTC
Same on KDE neon 5.20.5
Comment 2 popov895 2021-02-15 17:14:03 UTC
Adding the following lines to /etc/sddm.conf.d/kde_settings.conf (in addition to the editing of the theme.conf.user as stated in the Comment1) completely solves this issue for me:

    [Theme]
    Font=Noto Sans,12,-1,5,50,0,0,0,0,0

But this only works for sddm version 0.19.
Comment 3 Nate Graham 2021-02-16 15:42:55 UTC
Hmm, so are we serializing the font data to the config file incorrectly?
Comment 4 David Redondo 2021-02-16 15:47:39 UTC
I have no idea, I did not touch any of this sync stuff (tbf I did by moving it around). But this is 5.20.5 and there wasn't any change https://invent.kde.org/plasma/sddm-kcm/-/commits/Plasma/5.20
Comment 5 Filip Fila 2021-02-16 16:00:38 UTC
The currently supported way of syncing the font isn't too friendly. See:
https://www.reddit.com/r/kde/comments/j6vz2u/tip_how_to_change_the_font_on_the_login_screen/

For SDDM versions 0.19 and up we can actually properly sync the font if we land this:
https://phabricator.kde.org/D23257

Nate and/or David, can you check if it still works and push it? If not, I can give it a try when I find some time.
Comment 6 popov895 2021-02-16 16:41:49 UTC
First, sddm breeze theme uses both config.fontSize and PlasmaCore.Theme.defaultFont.pixelSize, which looks weird. I guess we need to use one or the other.

Second, it looks like sddm ignores the font specified in /var/lib/sddm/.config/kdeglobals. But it works fine with "sddm-greeter --test-mode". Is something wrong with the sddm user or his environment?

By the way, the tip from reddit in Comment5 allows you to set the font only, but not its size. Besides, this doesn't work for me on Plasma 5.20.5.
Comment 7 Nate Graham 2021-02-19 16:04:21 UTC
Git commit 56449c24560e87a9a61c242b59483b057d22917f by Nate Graham, on behalf of Filip Fila.
Committed on 19/02/2021 at 16:03.
Pushed by ngraham into branch 'Plasma/5.21'.

Allow for easier syncing of Plasma font

Summary:
Currently the user needs to have a fonts replacment file in `/.config/fontconfig/conf.d/` if they want to sync their Plasma font with SDDM.

That's not a good solution because users simply don't have this file or wouldn't know how to create it themselves.

In conjuction with https://github.com/sddm/sddm/pull/1191 this patch removes the need for additional user effort and allows for easy font syncing by writing the Plasma font value to the SDDM config file.

Test Plan: Dependency:  https://github.com/sddm/sddm/pull/1191

Reviewers: ngraham, #plasma, davidedmundson

Reviewed By: ngraham

Subscribers: davidre, plasma-devel

Tags: #plasma

Maniphest Tasks: T12710

Differential Revision: https://phabricator.kde.org/D23257

(cherry picked from commit 8171db27525bbbcc785e84b35b02aacaece41a58)
FIXED-IN: 5.21.1

M  +14   -0    src/sddmkcm.cpp

https://invent.kde.org/plasma/sddm-kcm/commit/56449c24560e87a9a61c242b59483b057d22917f
Comment 8 popov895 2021-03-09 10:14:32 UTC
Syncing of font only works if ~/.config/kdeglobals contains a "font" entry, i.e. user changed the default font. Otherwise, the SDDM uses its default font, which is "Sans Serif 9".
Comment 9 popov895 2021-03-09 10:24:04 UTC
The strange thing is that on openSUSE it works as it should, even if there is no "font" entry in ~/.config/kdeglobals.
Comment 10 Nate Graham 2021-03-09 16:01:03 UTC
Probably because openSUSE distros ship a default font size in their config files that mirrors the default one, so the sync system does see an actual value there.
Comment 11 popov895 2021-03-22 13:22:03 UTC
Can we do the same for the Neon?
Comment 12 Nate Graham 2021-03-22 18:50:16 UTC
No, we should fix the bug, not work around it at the distro level.
Comment 13 popov895 2021-03-23 10:20:47 UTC
Can we use `QApplication::font()` or `QFontDatabase::systemFont(QFontDatabase::GeneralFont)` to get default Plasma font if there is no "font" entry in the ~/.config/kdeglobals?
Comment 14 Nate Graham 2021-03-23 12:14:38 UTC
Yeah.
Comment 15 Nate Graham 2021-03-31 19:22:42 UTC
Fixed by Eugene Popov with https://invent.kde.org/plasma/sddm-kcm/-/commit/ed60574f34c9b0dc2f9c4949c6edfa5496e12a71 in Plasma 5.21.4!