Bug 414174 - Panel background transition animation not playing
Summary: Panel background transition animation not playing
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-15 13:29 UTC by adrien.brunelat
Modified: 2019-11-19 19:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adrien.brunelat 2019-11-15 13:29:27 UTC
SUMMARY

When setting the option "prefer opaque background when touching any window" is set, the transition animation form opaque to transparent is not played when window quit touching the panel.

STEPS TO REPRODUCE
1. Set a default panel background preferably not too dark (i.e. transparency 50%)
2. Tick "prefer opaque background when touching any window"
3. Maximize a window
4. Minimize the window

OBSERVED RESULT
The panel background turns instantly to the default panel without any smooth fade in animation

EXPECTED RESULT
A fade in animation form the initial background to the target much like when maximizing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
(available in About System)
KDE Plasma Version: 5.17.2
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Does this project accept contributors? Can I contribute by trying to fix this one?
Comment 1 Michail Vourlakos 2019-11-15 15:22:59 UTC
yeah, I know this is a workaround in order to handle the case. If you manage to improve/fix it this would be really good news. Contributions of course and they are accepted through kde phabricator page in order to be discussed and approved first before merging them in the code.

The file you are interested in is: https://phabricator.kde.org/source/latte-dock/browse/master/containment/package/contents/ui/PanelBox.qml

Information: PanelBox is responsible for the background shown to the user based on the current plasma them and the user settings. In order to solve limitations arising from plasma theming PanelBox is using FOUR different layers.

1. shadowsSvgItem: is responsible to draw the panel shadows when they are not drawn externally from kwin
2. backgroundLowestRectangle: is responsible to provide full correct solidness when a plasma theme does not support it on its own. There are plasma themes that they panel backgrounds provide maximum 70% opacity. for the remaining 30% the backgroundLowestRectangle is also used.
3. solidBackground: it is responsible to draw the true plasma panel background and is used as a center place to handle all the rest layers
4. overlayedBackground: is responsible to provide all the extras found in Latte. Meaning Smart coloring from windows or desktop background and Outlines. These features were not possible to be supported by using just the "solidBackground" layer.
Comment 2 adrien.brunelat 2019-11-18 17:59:07 UTC
So, I think I fixed it. Unsure because it was a one-liner:
PanelBox.qml, line 178:
NumberAnimation { duration: barLine.animationTime }

instead of
NumberAnimation { duration: 0 }

Now, I'd like to submit it myself (so that I can proudly say that I wrote code for Latte/KDE). So I'm looking for the phabricator procedure.

But just in case you have comments about my changes, well there it is, I'm posting it here.
Comment 3 adrien.brunelat 2019-11-18 17:59:38 UTC
With more context, the modified code look like this:

        Behavior on opacity{
            enabled: !Latte.WindowSystem.compositingActive
            NumberAnimation { duration: barLine.animationTime }
        }
Comment 4 adrien.brunelat 2019-11-18 18:20:36 UTC
Hm, my tests was a false positive. My eyes are playing tricks on me. It doesn't work and now that I know it doesn't what I wrote looks a little bit stupid. I'm back on it.
Comment 5 adrien.brunelat 2019-11-18 22:20:58 UTC
Ok this time I've spent a bit of time on the code to understand it. Sorry about previous messages, I rushed it.

The problem comes from overlayedBackground that appears briefly at full opacity when de-maximizing the window. In order to debug it, I forced its color to red.

But what's weird is that in only appears at the short moment when I reduce a window. I don't see it shown any other time. Can you provide an example of config where it should be shown?
Comment 6 adrien.brunelat 2019-11-18 22:25:59 UTC
When the theme is set to "smart" the issue doesn't occur. It only happens with "plasma".
Comment 7 Michail Vourlakos 2019-11-19 06:49:08 UTC
The overlayedBackground is most commonly applied when the user has chosen Reverse Colors or/and when the user has chosen to use Colors from the Active or Touching window.
Comment 8 Michail Vourlakos 2019-11-19 06:49:20 UTC
The overlayedBackground is most commonly applied when the user has chosen Reverse Colors or/and when the user has chosen to use Colors from the Active or Touching window.
Comment 9 adrien.brunelat 2019-11-19 10:56:50 UTC
Ok, this time I got it: https://phabricator.kde.org/D25392
Comment 10 carl 2019-11-19 16:54:34 UTC
Fixed in 0.9.5 by commit https://phabricator.kde.org/R878:a21f46d85ff8e589fbe377cce8495f9e80edd1f8
Comment 11 Michail Vourlakos 2019-11-19 19:17:19 UTC
Git commit e034f0bc9f7f42be31de0cd54270107fb6376b90 by Michail Vourlakos, on behalf of Adrien Brunelat.
Committed on 19/11/2019 at 19:17.
Pushed by mvourlakos into branch 'v0.9'.

[414174] - Panel background transition color bug

Summary:
Added animation on background color change.
Removed test for background color that is not needed any more.
FIXED-IN:0.9.5

Reviewers: mvourlakos

Reviewed By: mvourlakos

Subscribers: ognarb, plasma-devel

Tags: #plasma

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

M  +11   -7    containment/package/contents/ui/PanelBox.qml

https://commits.kde.org/latte-dock/e034f0bc9f7f42be31de0cd54270107fb6376b90