Bug 419080 - Window doesn't have correct size when using themes with Aurorae theme engine
Summary: Window doesn't have correct size when using themes with Aurorae theme engine
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: aurorae (show other bugs)
Version: 5.18.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://invent.kde.org/plasma/kwin/-/...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-21 19:18 UTC by Xu Zhao
Modified: 2020-05-21 10:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
vlad.zahorodnii: ReviewRequest+


Attachments
The window overflows the title bar (13.26 KB, image/jpeg)
2020-03-21 19:18 UTC, Xu Zhao
Details
The screenshot when the compositing is turned off. (14.75 KB, image/png)
2020-03-21 19:48 UTC, Xu Zhao
Details
Broken aurorae Theme maximized (266.74 KB, image/png)
2020-05-20 02:36 UTC, Leszek Lesner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xu Zhao 2020-03-21 19:18:46 UTC
Created attachment 126931 [details]
The window overflows the title bar

SUMMARY
The window overflows when using Aurorae theme engine together with Nvidia proprietary display driver.

STEPS TO REPRODUCE
1. Change the window decoration theme to McMojave Light
2. Start any application

OBSERVED RESULT
The window overflows the title bar

EXPECTED RESULT
The window should be within the title bar

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  openSUSE Tumbleweed 20200318
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Display Driver: Nvidia 440.64
Window Decoration Theme: McMojave-Light, or Breezemite

ADDITIONAL INFORMATION
This bug does not exist when using Intel/Nouveau drivers.
See the screenshot for details.
Comment 1 David Edmundson 2020-03-21 19:29:10 UTC
>This bug does not exist when using Intel/Nouveau drivers.

That sounds unlikely.

Is it the same machine? 
Does it affect every window when the bug exhibits itself?
For the whole session?

>Window Decoration Theme: McMojave-Light, or Breezemite

And all Aurorae themes are affected?

Does toggling compositing (alt+shift+f12) make a difference?
Comment 2 Xu Zhao 2020-03-21 19:48:21 UTC
(In reply to David Edmundson from comment #1)
> >This bug does not exist when using Intel/Nouveau drivers.
> 
> That sounds unlikely.
> 
> Is it the same machine? 
> Does it affect every window when the bug exhibits itself?
> For the whole session?
Yes, it affects every window for the whole session.
I can reproduce the bug on at least three machines using Nvidia display driver. However, they are all in openSUSE Tumbleweed.
> 
> >Window Decoration Theme: McMojave-Light, or Breezemite
> 
> And all Aurorae themes are affected?
I have tested a few Aurorae themes. It seems all of them are affected.
- Breezemite
- Breezemite_dark
- McMojave
- McMojave-light
- Qogir-light
- Sweet-Dark

> 
> Does toggling compositing (alt+shift+f12) make a difference?
The bug persists. You can find the screenshot after toggling the compositing in the new attachment.
Comment 3 Xu Zhao 2020-03-21 19:48:46 UTC
Created attachment 126932 [details]
The screenshot when the compositing is turned off.
Comment 4 Leszek Lesner 2020-05-20 00:25:43 UTC
Can confirm with Kwin 5.18.90 aswell. 
Every aurorae theme looks like some pixels are missing maximized.
Comment 5 Leszek Lesner 2020-05-20 02:36:38 UTC
Created attachment 128620 [details]
Broken aurorae Theme maximized
Comment 6 Vlad Zahorodnii 2020-05-20 15:45:51 UTC
Urgh, I introduced this regression...

15af09c70a890424759b092a3597bf76ab308632 is the first bad commit
commit 15af09c70a890424759b092a3597bf76ab308632
Author: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date:   Wed Feb 5 11:28:50 2020 +0200
Comment 7 Vlad Zahorodnii 2020-05-20 15:55:45 UTC
So, I think I know what is going on... The problem is that frameGeometryChanged is not emitted when the client size changes. We need a different signal for client size changes and then use it in DecoratedClientImpl.
Comment 8 Vlad Zahorodnii 2020-05-20 15:57:14 UTC
Still, I don't get why everything works as expected with Breeze decoration.
Comment 9 David Edmundson 2020-05-21 09:55:43 UTC
> Git commit 621b2e1cde28c0824df2009f12289ade560272d5 by David Edmundson, on behalf of Vlad Zahorodnii.
> Committed on 21/05/2020 at 09:44.
> Pushed by davidedmundson into branch 'Plasma/5.19'.
>
> [decoration] Fix propagation of client size
>
> Even though the frame geometry and the client geometry have a connection
> between themselves, it doesn't mean that the frame geometry will change
> if the client geometry has changed and vice versa. For example, it can be
> the case when the border size changes. The frame geometry won't change,
> but the client geometry will.
>
> In general, similar to the frameGeometryChanged signal, we need another
> signal that is emitted when the client geometry has been changed that
> can be used then in DecoratedClientImpl.
>
> Unfortunately, 5.19 release is around the corner and I would prefer not
> to do any geometry-related changes in order to avoid introducing new
> regressions.
>
> In order to fix the propagation of the client size to decorations, this
> change ports DecoratedClientImpl from frameGeometryChanged to a signal
> that is emitted whenever geometry of any kind has been changed.
> FIXED-IN: 5.19.0
>
> M  +1    -1    decorations/decoratedclient.cpp
Comment 10 Vlad Zahorodnii 2020-05-21 10:05:30 UTC
(In reply to Vlad Zahorodnii from comment #8)
> Still, I don't get why everything works as expected with Breeze decoration.

It doesn't happen with Breeze decoration because it updates the borders right after the window has become maximized. On the other hand, Aurorae delays the update of window borders.