Bug 400980

Summary: Decorations get huge after reboot with specific font size
Product: kwin Reporter: Mahendra Tallur <mahen>
Component: decorationsAssignee: Vlad Zahorodnii <vlad.zahorodnii>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version: 5.14.2   
Target Milestone: ---   
Platform: Neon Packages   
OS: Linux   
Latest Commit: Version Fixed In: 5.15.0

Description Mahendra Tallur 2018-11-12 20:35:41 UTC
SUMMARY

When using the Roboto 12 font as window title font, and rebooting, decorations become and remain huge (as long as one doesn't change the font size then reboot)


STEPS TO REPRODUCE
1. Choose the Roboto 11 font as title font
2. Reboot

OBSERVED RESULT

Immediatly after 1., decorations looked good. After 2., decorations get huge.

EXPECTED RESULT

After 1. and after 2., decorations should look the same.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION

Please have a look at the following screenshots, taken in this order :
(/!\ pic. titles are incorrect)

1. After setting Roboto 11 as window title font 
https://ibb.co/n2Ef7q (looks good)

2. After rebooting (with Roboto 11)
https://ibb.co/kky1DV (decoration became too large)

3. After 2. and setting Roboto 10
https://ibb.co/hra3Sq (as you can see the decoration remains huge)

4. After 3. and a second reboot and keeping Roboto 10
https://ibb.co/gWNHnq (decorations are back to normal)

Clean install, KDE Neon up to date as of today. I tried with a clean user too. Using Breeze.
Comment 1 Mahendra Tallur 2018-11-12 20:38:36 UTC
Oops, I mixed sizes up. The SUMMARY should obviously be : 

"When using the Roboto 11 font as window title font, and rebooting, decorations become and remain huge (as long as one doesn't change the font size then reboot)"
Comment 2 Vlad Zahorodnii 2018-11-12 21:41:02 UTC
Nah, it looks like that's indeed a bug in KDecoration. No one emits fontChanged.
Comment 3 Vlad Zahorodnii 2018-11-15 20:08:53 UTC
Git commit 80da18a143f1b57751e77f9574212ff60ff14950 by Vlad Zagorodniy.
Committed on 15/11/2018 at 20:08.
Pushed by vladz into branch 'master'.

[decorations] Emit DecorationSettings::fontChanged signal

Summary:
No one emits DecorationSettings::fontChanged signal, so if you change
the window title font, then titlebars might look differently after reboot.

Currently, there are two places where we can emit that signal:
- in KDecoration library itself;
- and in KWin.

Because we would need to listen for a Plasma specific D-Bus signal, the
latter option is preferable.

Surprisingly, KWin's implementation of DecorationSettingsPrivate already
reacts to refreshFonts D-Bus signal (even though indirectly), so all
what we have to do is get the current window title font in
SettingsImpl::readSettings, and if it's different from the previous one,
emit DecorationSettings::fontChanged signal.
FIXED-IN: 5.15.0

Test Plan:
* Increased the size of the window title font, titlebars got bigger;
* Decreased the font size, titlebars got smaller.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

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

M  +7    -0    decorations/settings.cpp
M  +4    -0    decorations/settings.h

https://commits.kde.org/kwin/80da18a143f1b57751e77f9574212ff60ff14950
Comment 4 Mahendra Tallur 2018-11-15 20:22:16 UTC
Thank you so much for the quick fix, Vlad !