Fix shadow gaps at rounded CSD corners (#32) - #37
Conversation
Windows with Client-Side Decorations (CSD) and rounded corners — such as Thunar with GTK decorations — show small gaps without shadow at the corners. This happens because fastcompmgr classifies ARGB non-override_redirect windows as SHADOW_NOCENTER. In this mode, the center of the shadow is made transparent by make_transparent_shadowcenter(), using a rigid rectangular cutout of the exact window size. The rounded corners of the window frame are transparent (alpha = 0), so the shadow underneath is also transparent, revealing whatever is behind the window. Fix: shrink the transparent center area by the window's frame extents (_NET_FRAME_EXTENTS), plus a minimum CORNER_MARGIN of 4 pixels to cover typical rounded-corner radii even when the window has no WM frame. - For CSD windows (Thunar, etc.), the frame extents are large (20-40 px). The transparent area is reduced, leaving the shadow visible under the decorative frame. Since the frame is opaque, the shadow is hidden — except at the rounded corners, where the frame is transparent and the shadow now shows through. Bug fixed. - For transparent terminals and other ARGB windows without frames, the frame extents are 0, so the CORNER_MARGIN of 4px applies. This leaves a small shadow halo at the edges, which is visually acceptable and prevents the gap at rounded corners. Only fastcompmgr.c is touched. The win struct already carries left_width, right_width, top_width, bottom_width from get_frame_extents().
|
Thank you. I just merged this into the dev branch: 474dcdb It will land in master soon. |
In the xfce4 notification, during fade out, this renders an ugly square shadow. Thus I am probably going to ditch the artificial margin. Do you have an example, where it is useful? |
|
Yes, it is! Sadly, the solution has some not-very-beautiful effects on some cases. But it was the easy and simple way I found to solve without making huge changes in code. In my earlier issue there are more info and you can see some screenshots: #32 Cheers!!! |
|
FYI: I found some more quirks. |
|
Now I understand better. I think you're right, and I also think it's great news that you've found a better way to solve this. Thank you so much for your interest, dedication... and patience with me. ;) |


Summary
Fixes #32 — windows with rounded Client-Side Decoration (CSD) corners show small gaps without shadow.
Problem
ARGB non-
override_redirectwindows (e.g. Thunar with GTK decorations) are classified asSHADOW_NOCENTER. The shadow center is made transparent bymake_transparent_shadowcenter()using a rigid rectangular cutout of the exact window size. The rounded corners of the CSD frame are transparent (alpha=0), so the shadow underneath is also transparent, revealing whatever is behind the window.Solution
Shrink the transparent center area by the window's
_NET_FRAME_EXTENTS, plus a minimumCORNER_MARGINof 4 px to cover typical rounded-corner radii (3–5 px) even when the window has no WM frame.For CSD windows (Thunar, etc.)
For transparent terminals / frameless ARGB windows
CORNER_MARGINof 4 px applies.Scope
fastcompmgr.cis touched (4 function signatures updated).winstruct already carriesleft_width,right_width,top_width,bottom_widthfromget_frame_extents().paint_all()). The change only runs once per window when the shadow is created.Testing
make clean && makeproduces zero warnings, zero errors.