Bug 426143

Summary: Kwin didn't drop shadows in some cases:
Product: [Plasma] kwin Reporter: Giovanni Santoni <giovanni.santoni72>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: giovanni.santoni72
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Google chrome and popups
Qmmp no shadows
Intellij menus no shadow
Chrome with _KDE_NET_WM_SHADOW

Description Giovanni Santoni 2020-09-03 13:29:05 UTC
Created attachment 131389 [details]
Google chrome and popups

Kwin didn't drop shadows in some cases:

Google chrome main windows and popups.
Shaped windows i.e. android studio emulators.
Qmmp
Non gtk toolkit popups (i.e emacs using xaw3d or Intellij IDE using java)
Electron applications i.e. Visual Studio code or MS Teams client.





SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.73
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Comment 1 Giovanni Santoni 2020-09-03 13:32:28 UTC
Created attachment 131391 [details]
Qmmp no shadows
Comment 2 Giovanni Santoni 2020-09-03 13:36:13 UTC
Created attachment 131392 [details]
Intellij menus no shadow
Comment 3 Giovanni Santoni 2020-09-03 13:39:12 UTC
Gnome mutter is able to draw correctly shadow in all those cases giving a more consistent desktop experience.
Comment 4 Vlad Zahorodnii 2020-09-03 14:11:26 UTC
Client-side decorated windows (Google Chrome and practically every electron app) must draw drop-shadows on their own. Please report this issue to Google Chrome developers.

Same goes to Intellij IDEA. It needs to draw drop-shadows for popups on its own or provide shadow tiles via our proprietary protocols [1] [2].

[1] https://community.kde.org/KWin/Shadow
[2] https://invent.kde.org/libraries/plasma-wayland-protocols/-/blob/master/src/protocols/shadow.xml
Comment 5 Giovanni Santoni 2020-09-03 14:34:13 UTC
Ok but as a workaround would be possible to provide a drop shadow effect (like the one before plasma 4.6) to provide shadows for all the applications which dont 
draw drop-shadows on their own?

If is in theory possible a would like to try to implement one on myself. 
Where i can find some documentation to start?
Comment 6 Vlad Zahorodnii 2020-09-04 06:28:52 UTC
You could fork the old shadow effect https://github.com/KDE/kde-workspace/tree/KDE/4.6/kwin/effects/shadow

If you'd like to have an example of an out of source tree effect, see https://github.com/zzag/kwin-effects-sliding-notifications

I hope this helps.
Comment 7 Giovanni Santoni 2020-09-04 07:30:09 UTC
Created attachment 131412 [details]
Chrome with _KDE_NET_WM_SHADOW
Comment 8 Giovanni Santoni 2020-09-04 07:30:59 UTC
Hi tank you for the link i will do some test immediately.
By the way i tried to manually add _KDE_NET_WM_SHADOW to google Chrome:


xprop -id 0x4600005 -f  _KDE_NET_WM_SHADOW 32c -set  _KDE_NET_WM_SHADOW 35651649,35651659,35651660,35651661,35651662,35651663,35651664,35651665,8,8,1,8

copying the id of the pixmaps and the offsets from the plasma panel and it works.