Bug 314427 - Fade effect does not honor current window opacity
Summary: Fade effect does not honor current window opacity
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: effects-window-management (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 4.10.1
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/108...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-04 16:14 UTC by Aurelien Gateau
Modified: 2018-09-27 17:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Gateau 2013-02-04 16:14:26 UTC
When the fade effect fades a window out, it sets the opacity to 1.0 and fades it to 0, instead of starting from the current opacity value.

Reproducible: Always

Steps to Reproduce:
1. Build the "plasma-dialog" branch of kde:colibri.
2. Show a notification.
3. Notice the flashing notification once it has faded out.
Comment 1 Martin Flöser 2013-02-04 16:26:34 UTC
I'll rewrite the fade effect to use the new animate syntax and specify w.opacity as animation start/end
Comment 2 Thomas Lübking 2013-02-04 16:49:46 UTC
I've not seen the particular issue, but

case Opacity:
   data.multiplyOpacity(interpolated(*anim)); break;

have doubts that setting the opacity to any value <=1 could increase the effective one (by that effect)

For that reason using w.opacity would be wrong. The effect opacity operates multiplicative on the window opacity anyway (just tested, lowered opacity of a window and rand the fade effect on it - there's no visual artifact)

@Aurelien
You say "Notice the flashing notification once it has faded out" what seems to indicate the window is correctly faded out but then briefly re-appears at full opacity on screen. Is this correct?
Comment 3 Martin Flöser 2013-02-06 10:11:00 UTC
some investigation update:

colibri fades out itself by using QWidget::setOpacity(). So the window fades out by itself, then turns back to full opacity and is faded out again by the fade effect.

I added debug statements in Unmanaged::windowEvent() and see there that at the end of colibri's fade out animation it sometimes turns back to 1, sometimes stays at 0. This is independent of the usage of fade effect.
Comment 4 Martin Flöser 2013-02-06 10:45:33 UTC
It seems like Qt is deleting the property which causes void NETWinInfo::event() to reset the value to the default value. Using:

diff --git a/kdeui/windowmanagement/netwm.cpp b/kdeui/windowmanagement/netwm.cpp
index cf28339..f4b7070 100644
--- a/kdeui/windowmanagement/netwm.cpp
+++ b/kdeui/windowmanagement/netwm.cpp
@@ -4408,7 +4408,7 @@ void NETWinInfo::update(const unsigned long dirty_props[]) {
 
     if (dirty2 & WM2Opacity)
     {
-        p->opacity = 0xffffffffU;
+//         p->opacity = 0xffffffffU;
        if (XGetWindowProperty(p->display, p->window, net_wm_window_opacity, 0l,
                               MAX_PROP_SIZE, False, XA_CARDINAL, &type_ret,
                               &format_ret, &nitems_ret, &unused, &data_ret)

makes the value not being reset any more. The patch cannot be applied in KWindowSystem as that would be wrong. Deleting the property should mean reset to default.

I'll try to get confirmation that Qt deletes the property, then I'll change to upstream.
Comment 5 Martin Flöser 2013-02-06 14:40:04 UTC
Further investigation showed that XGetWindowProperty failed with a BadRequest error in that case.

ReviewRequest posted to no longer reset unconditionally (https://git.reviewboard.kde.org/r/108808/ )
Comment 6 Aurelien Gateau 2013-02-07 12:47:03 UTC
(In reply to comment #2)
> @Aurelien
> You say "Notice the flashing notification once it has faded out" what seems
> to indicate the window is correctly faded out but then briefly re-appears at
> full opacity on screen. Is this correct?

Yes that is what happens.
Comment 7 Alexander Mentyu 2018-09-20 14:45:39 UTC
Cannot reproduce.
Changed modifier key for opacity in Window Behavior to Alt+Mouse Wheel and tested "notify-send 'Hello world!' 'This is an example notification.' --icon=dialog-information" command with changing it's opacity by Alt+Mouse Wheel - the notification fades out from current level of opacity

Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.14.80
Qt Version: 5.11.1
KDE Frameworks Version: 5.51.0
Kernel Version: 4.15.0-34-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7,7 GiB of RAM
Comment 8 Alexander Mentyu 2018-09-20 14:49:49 UTC
Same on Wayland