Bug 312168

Summary: Plasma popup shadows not drawn during slide animation
Product: [Plasma] kwin Reporter: Kai Uwe Broulik <kde>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aseigo, ht990332, notmart
Priority: NOR Keywords: regression
Version: 4.9.95 (RC 1)Flags: mgraesslin: ReviewRequest+
Target Milestone: 4.10 RC 3   
Platform: Other   
OS: Linux   
URL: https://git.reviewboard.kde.org/r/108255/
Latest Commit: Version Fixed In: 4.10

Description Kai Uwe Broulik 2012-12-24 15:44:20 UTC
With the new Air theme the shadows around Plasma popups are not rendered while they are sliding in or out

Reproducible: Always

Steps to Reproduce:
1. Use new Air theme in KDE 4.10 RC1
2. Click eg. battery monitor or NM applet
3.
Actual Results:  
Shadow is only drawn when the sliding animation is done, not while it is animating

Expected Results:  
Shadow is drawn (like Blur) during the entire animation

Maybe KWin issue?
Comment 1 Kai Uwe Broulik 2012-12-24 16:29:53 UTC
I guess it's a KWin issue. Seems that KWin clips the popup texture while transitioning. The shadow above the popup is rendered (until it gets outside the clipping box at the end of the animation) while the shadow on the sides is not during the transition
Comment 2 Thomas Lübking 2012-12-24 18:27:53 UTC
Not here - regardless of blur, backend (except gles not tested) "SlidingPopups" or "GenericAnimations"

We had similar (hit the tabbox shadows) but that should be fixed (code suggests that)

Can you share your supportInformation?
Compiled from sources?
Comment 3 Kai Uwe Broulik 2012-12-24 20:35:54 UTC
Reproduceable on both 4.10 RC1 as well as today's master. Only visible with SlidingPopups enabled, without works fine but then the dialog either zooms in or fades in, doesn't slide, of course. 

KWin-Unterstützungsinformationen:
Benutzen Sie die folgenden Informationen, wenn Sie nach Unterstützung fragen, z. B. auf http://forum.kde.org.
Sie enthalten Informationen über die momentan laufende Instanz, welche Optionen verwendet werden,
welcher OpenGL-Treiber verwendet wird und welche Effekte laufen.
Bitte geben Sie die untenstehenden Informationen bei einem Pastebin-Dienst wie http://paste.kde.org ein, anstatt sie direkt in die Hilfediskussionen zu schreiben.

==========================

Options
=======
focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
activeMouseScreen: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
showDesktopIsMinimizeAll: false
rollOverDesktops: true
focusStealingPreventionLevel: 1
legacyFullscreenSupport: false
operationTitlebarDblClick: 
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: false
condensedTitle: false
electricBorders: false
electricBorderDelay: 50
electricBorderCooldown: 200
electricBorderPushbackPixels: 1
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: true
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 2
unredirectFullscreen: false
glSmoothScale: 1
glVSync: true
colorCorrected: false
xrenderSmoothScale: false
maxFpsInterval: 17
refreshRate: 0
vBlankTime: 6144
glDirect: true
glStrictBinding: false
glStrictBindingFollowsDriver: true
glLegacy: false

Compositing
===========
Qt Graphics System: raster
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL version string: 3.0 Mesa 9.1-devel
Driver: Intel
GPU class: IvyBridge
OpenGL version: 3.0
Mesa version: 9.1
X server version: 1.13
Linux kernel version: 3.5
Direct rendering: yes
Requires strict binding: no
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used

Loaded Effects:
---------------
kwin4_effect_dimscreen
kwin4_effect_lookingglass
kwin4_effect_trackmouse
kwin4_effect_mousemark
kwin4_effect_maximize
kwin4_effect_login
kwin4_effect_slidingpopups
kwin4_effect_wobblywindows
kwin4_effect_coverswitch
kwin4_effect_minimizeanimation
kwin4_effect_scalein
kwin4_effect_screenshot
kwin4_effect_cube
kwin4_effect_slide
kwin4_effect_desktopgrid
kwin4_effect_fade
kwin4_effect_dialogparent
kwin4_effect_highlightwindow
kwin4_effect_taskbarthumbnail
kwin4_effect_presentwindows
kwin4_effect_blur
kwin4_effect_logout
kwin4_effect_dashboard
kwin4_effect_outline
kwin4_effect_startupfeedback

Currently Active Effects:
-------------------------
kwin4_effect_blur

Effect Settings:
----------------
kwin4_effect_dimscreen:

kwin4_effect_lookingglass:
initialRadius: 200

kwin4_effect_trackmouse:
modifiers: 335544320
mousePolling: true

kwin4_effect_mousemark:
width: 3
color: #ff0000

kwin4_effect_maximize:

kwin4_effect_login:
fadeToBlack: false

kwin4_effect_slidingpopups:
fadeInTime: 250
fadeOutTime: 250

kwin4_effect_wobblywindows:
stiffness: 0.06
drag: 0.9
moveFactor: 0.1
xTesselation: 20
yTesselation: 20
minVelocity: 0
maxVelocity: 1000
stopVelocity: 0.5
minAcceleration: 0
maxAcceleration: 1000
stopAcceleration: 0.5
moveEffectEnabled: true
openEffectEnabled: false
closeEffectEnabled: false
moveWobble: true
resizeWobble: false

kwin4_effect_coverswitch:
animationDuration: 200
animateSwitch: true
animateStart: true
animateStop: true
reflection: true
windowTitle: true
zPosition: 900
dynamicThumbnails: true
thumbnailWindows: 8
primaryTabBox: true
secondaryTabBox: false

kwin4_effect_minimizeanimation:

kwin4_effect_scalein:

kwin4_effect_screenshot:

kwin4_effect_cube:
cubeOpacity: 0.800000011920929
opacityDesktopOnly: false
displayDesktopName: true
reflection: true
rotationDuration: 500
backgroundColor: #000000
capColor: #d6d2d0
paintCaps: true
closeOnMouseRelease: false
zPosition: 100
useForTabBox: false
invertKeys: false
invertMouse: false
capDeformationFactor: 0
useZOrdering: false
texturedCaps: true

kwin4_effect_slide:

kwin4_effect_desktopgrid:
zoomDuration: 300
border: 10
desktopNameAlignment: 0
layoutMode: 0
customLayoutRows: 2
usePresentWindows: true

kwin4_effect_fade:

kwin4_effect_dialogparent:
changeTime: 300

kwin4_effect_highlightwindow:

kwin4_effect_taskbarthumbnail:

kwin4_effect_presentwindows:
layoutMode: 0
showCaptions: true
showIcons: true
doNotCloseWindows: true
ignoreMinimized: false
accuracy: 20
fillGaps: true
fadeDuration: 150
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 6
leftButtonDesktop: 2
middleButtonDesktop: 3
rightButtonDesktop: 0
dragToClose: false

kwin4_effect_blur:
blurRadius: 14
cacheTexture: true

kwin4_effect_logout:
useBlur: true

kwin4_effect_dashboard:
brightness: 0.5
saturation: 0.36
blur: true

kwin4_effect_outline:

kwin4_effect_startupfeedback:
Comment 4 Thomas Lübking 2012-12-24 21:33:02 UTC
Before i punish myself: do you happen to know whether it also wobbles?
Comment 5 Kai Uwe Broulik 2012-12-24 21:49:31 UTC
Doesn't wobble when sliding in/out, only wobbles when I manually move it using Alt+Click (which shouldn't move the window in the first place)
Comment 6 Kai Uwe Broulik 2012-12-26 11:25:47 UTC
Using the "Color redraw areas" effect, you can see that there actually is some border/shadow supposed to be drawn outside the popup - there is a 20px area that is redrawn but for no visible reason

As far as I can tell there are other parts of the Plasma theme affected by this wrong clipping/redrawing area as well:
- Panelcontroller has shadow on both sides
- On Screen Displays (volume change, brightness change) has no shadow at all
- Tooltips sometimes leave ghostshadows behind when they disappear
Comment 7 Thomas Lübking 2012-12-26 20:28:57 UTC
(In reply to comment #6)
> Using the "Color redraw areas"
"Show repaint" =)
I somewhen have to install the i18n package ;-)

> some border/shadow supposed to be drawn outside the popup - there is a 20px
> area that is redrawn but for no visible reason
could be for blurring / wobbling - try deactivating both effects.

Does this also happen with the xrender backend?
(or tell me which git repo contains the "new" air theme ;-)
 
> As far as I can tell there are other parts of the Plasma theme affected by
> this wrong clipping/redrawing area as well:
> - Panelcontroller has shadow on both sides
I guess it's supposed to have them on only one (far edge from the panel)?
-> plasma bug, make better shadow pixmaps or offsets (or keep the controller under the panel, XRestackWindows, since it's likely unmanaged)

> - On Screen Displays (volume change, brightness change) has no shadow at all
Do they have alpha at all? (see bug #311995)

> - Tooltips sometimes leave ghostshadows behind when they disappear
Should be resolved. Execution order in plasma, maybe missing X11 sync and/or insufficient damage robustness in kwin
Comment 8 Kai Uwe Broulik 2012-12-26 20:35:49 UTC
(In reply to comment #7)
> Does this also happen with the xrender backend?
Also happens with XRender

> (or tell me which git repo contains the "new" air theme ;-)
I just got it alongside with the upgrade to KDE 4.10 RC1. 
It lives in: [kde-runtime] desktoptheme/air 
(I have no idea who came up with that "system" in where the artwork lives, some is on SVN kde-artwork, some in kde-baseartwork, some is directly in the app using it …)

> I guess it's supposed to have them on only one (far edge from the panel)?
> -> plasma bug, make better shadow pixmaps or offsets (or keep the controller
> under the panel, XRestackWindows, since it's likely unmanaged)
Right. So, theme issue or new shadow system issue. Stacking under would not work since then you would have the panel shadow above the panelcontroller

> Do they have alpha at all? (see bug #311995)
Is has alpha, it looks normal (transparency with blur) just without the shadow, so you can eg. hardly see it when in front of a white webpage
Comment 9 Hussam Al-Tayeb 2012-12-26 20:39:39 UTC
same here. the OSD volume has no shadow. This worked in 4.9.x

Sorry for spamming but plasma panel/etc.. looked beautiful in 4.9.x so why were there changes to the theme?
Comment 10 Thomas Lübking 2012-12-26 21:05:08 UTC
(In reply to comment #8)

> > Do they have alpha at all? (see bug #311995)
> Is has alpha, it looks normal (transparency with blur) just without the
> shadow, so you can eg. hardly see it when in front of a white webpage

Random guess here would be that the shadow is set before the ARGB hint (what causes Qt to create a new window, lacking all properties of the original one) - adding, withdrawing and altering shadows works reliably on eg. the bespin decoration since i don't know when.
Comment 11 Kai Uwe Broulik 2012-12-28 18:32:05 UTC
Now that KWin renders shadows for Plasma, I suspect the 
Plasma::WindowEffects::overrideShadow(winId(), true);
in the brightnessosdwidget to be the cauae
Comment 12 Martin Flöser 2012-12-28 18:46:41 UTC
nope, that's actually a no-op from KWin point of view. The method sets the property "_KDE_SHADOW_OVERRIDE", but searching for it in KWin src folder returns 0 results. I think it used to be used in the old shadow effect.
Comment 13 Thomas Lübking 2012-12-28 18:58:13 UTC
(In reply to comment #12)
> I think it used to be used in the old shadow effect.
Yes.

Also that would not explain why it's there later one, resp. (even more strange) why it's there, but clipped (in either XRender AND OpenGL which use totally different clipping) while the repaint area seems to be right.

Compiled and installed "new" theme btw., but there's no difference (and the panels etc. don't have a shadow hint - maybe this was added to libplasma *very* recently?)
Comment 14 Kai Uwe Broulik 2012-12-28 19:04:08 UTC
You mean using KWin for Plasma shadows? It's just a few weeks old:
https://git.reviewboard.kde.org/r/107327/
Comment 15 Kai Uwe Broulik 2012-12-29 00:54:02 UTC
Hmm, maybe we need to manually add a DialogShadow on the brightnessosdwidget now but I couldn't get it to dork (the dialogshadows thing is private)
Comment 16 Kai Uwe Broulik 2012-12-29 10:17:49 UTC
Just noticed that the Brightness OSD has no transparence whatsoever, it seems when it is launched (PowerDevil daemon) the compositor is not fully up and it seems to not notice when it is and so the Brightness OSD is in its non-composited state (ie. fully opaque, no shadow). The KMix OSD, however, is transparent with blur behind but also lacks a shadow. Really weird.
But was already broken in 4.10 Beta 2 with the old Air theme.
Comment 17 Thomas Lübking 2012-12-29 11:44:04 UTC
reg. absent ARGB, see https://git.reviewboard.kde.org/r/107983/

but i still cannot reproduce clipped shadows here (while they have a kwin shadow property) regardless of all kwin settings.
now trying plasma conditions - you use the raster graphicssystem and glib dispatcher, i assume?
Comment 18 Martin Flöser 2013-01-07 16:49:03 UTC
Adding Aaron and Marco to CC as it's another shadow related regression
Comment 19 Aaron J. Seigo 2013-01-07 17:46:03 UTC
(In reply to comment #12)
> nope, that's actually a no-op from KWin point of view. The method sets the
> property "_KDE_SHADOW_OVERRIDE", but searching for it in KWin src folder
> returns 0 results. I think it used to be used in the old shadow effect.

interesting. this means we can remove it in libplasma2 then ...
Comment 20 Aaron J. Seigo 2013-01-07 17:49:01 UTC
Yes, this has been the case from the moment we started using kwin's window shadow support. It is some sort of interaction with the slide in effect. Apparently the shadow does not get applied until the window is fully slid in or out.
Comment 21 Kai Uwe Broulik 2013-01-07 20:07:08 UTC
as far as I can see the shadow is applied but clipped at the sides. When you set animation speed to very slow, you can see that the shadow at the top of the popup (in case it emerging from a bottom panel) is drawn. I did a screencast but accidentally attached it to the wrong bug report.
Comment 22 Thomas Lübking 2013-01-07 20:52:11 UTC
(In reply to comment #21)
> accidentally attached it to the wrong bug report.

Being where? ;-)
Comment 23 Martin Flöser 2013-01-08 07:25:45 UTC
It's obvious why it is broken. From the code:
region = QRegion(w->x() + splitPoint, w->y(), w->width() - splitPoint, w->height());

region in the clip region to which the rendering is restricted. x(), y(), width() and height() are the geometry of the window. When the shadow used to be part of the window that worked. Now it is no longer part of the window and the shadow gets clipped away.
Comment 24 Thomas Lübking 2013-01-08 07:50:17 UTC
i could have simply put shadows under yakuake m(
works "nearly" with generic animations, but the source edge must not be clipped by the visualRect but geometry.
Comment 25 Martin Flöser 2013-01-11 07:51:47 UTC
Git commit e448aeb49efb031d93ce3fcefcca9c01fb920697 by Martin Gräßlin.
Committed on 08/01/2013 at 09:19.
Pushed by graesslin into branch 'KDE/4.10'.

Do not clip away shadows in SlidingPopupsEffect

Animation now completely based on the expandedGeometry which includes the
shadows and another repaint at the end of the animation is added to
ensure that there are no leftover shadows.
FIXED-IN: 4.10
REVIEW: 108255

M  +19   -16   kwin/effects/slidingpopups/slidingpopups.cpp

http://commits.kde.org/kde-workspace/e448aeb49efb031d93ce3fcefcca9c01fb920697