Bug 384408 - PanelView::setBackgroundHints doesn't update enabledBorders (which means it doesn't toggle the shadows)
Summary: PanelView::setBackgroundHints doesn't update enabledBorders (which means it d...
Status: NEEDSINFO WAITINGFORINFO
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.10.5
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-06 04:03 UTC by Chris Holland
Modified: 2025-09-23 19:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
2017 Panel.qml with blur (1.62 MB, image/png)
2025-09-23 19:09 UTC, Chris Holland
Details
Video alternating between backgroundHint on/off every 2sec (1.06 MB, video/mp4)
2025-09-23 19:12 UTC, Chris Holland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holland 2017-09-06 04:03:46 UTC
While fussing with /usr/share/plasma/shells/.../contents/views/Panel.qml, I tried dynamically disabling the blur+shadows on the panel (using a repeating timer). I noticed that while the blur effect went away, the shadows did not.

QML:
panel.backgroundHints = Plasma.Types.NoBackground

C++: https://github.com/KDE/plasma-workspace/blame/master/shell/panelview.cpp
setBackgroundHints(Plasma::Types::NoBackground)
emit backgroundHintsChanged()
connect(this, SIGNAL(backgroundHintsChanged()), this, SLOT(themeChanged()));

themeChanged() calls updateMask() but doesn't call updateEnabledBorders().
updateEnabledBorders() is what disables the panel shadow.

PanelView::resizeEvent and PanelView::moveEvent call both "update" functions, so 

You can test this by editing Panel.qml. Note that "panel" == PanelView.cpp.
Video: https://streamable.com/cishh

I did try resizing the panel, and the shadow did dissappear. However it did not reappear when I resized it again.
Comment 1 Kai Uwe Broulik 2017-09-06 08:45:10 UTC
There's also something wrong going on in PanelShadows. Even if I fix the issue you mentioned, the shadow doesn't re-appear after it's gone.

It never calls addShadow again after initialization but it does removeShadow when background hints become "NoBackground", so updateShadows won't do anything. I then fixed that but it still wouldn't help :/
Comment 2 Niccolò Venerandi 2025-09-23 12:23:24 UTC
May I ask for more information about what's happening here? Why are you trying to disable shadows from Panel.qml? What's the user-facing issue here?
Comment 3 Chris Holland 2025-09-23 19:09:40 UTC
Created attachment 185201 [details]
2017 Panel.qml with blur
Comment 4 Chris Holland 2025-09-23 19:12:27 UTC
Created attachment 185202 [details]
Video alternating between backgroundHint on/off every 2sec
Comment 5 Chris Holland 2025-09-23 19:26:12 UTC
After looking up the video in my archives since the streamable video is deleted, it looks like I was trying to make a fully transparent panel without shadows when windows weren't nearby, then apply the black panel with shadows when the windows were touching the panel.

Eg: This effect from a gnome extension https://www.youtube.com/watch?v=P5Eqf65uVhs

IIRC somebody already implemented "adaptive" transparency panels so this bug has probably already been fixed? Or maybe not. It looks like the panel is still drawing shadows in this "KDE Plasma 5.22: Adaptive Transparency" youtube video when it's in "transparent mode" since it's only "transluscent" not fully transparent.

https://www.youtube.com/watch?v=4exHfb8Qjl0

Looks like I'll need to try making an adaptive plasma style sometime to figure out if the bug still exists.