Skip to content

qt: increase the csd window margin on wayland

Fatih Uzunoğlu requested to merge fuzun/vlc:qt/csdwindowmargin into master

This is done to make the csd shadow look more natural, as with the current margin the blur/glow radius has to be quite limited for the shadows to fit in the window.

Currently window managers/compositors even use layered shadows (stacking of multiple shadows), so having one shadow that is concentrated looks odd in 2025. After this, we should also consider if we want to follow a similar approach. We currently have DoubleShadow, perhaps that would be nice to use it, at least as the first step.

I have done this only on Wayland (not X11) because there we use input mask to let the events pass through beyond the csd resize area (MainCtx.csdBorderSize). This means that we are practically free with regard to the margins, if we want it can be bigger.

Whereas on X11 we have to use a reasonable window margin, because the window would receive the input events also in this region. Even though we don't really consume the input events in this region in the application, these events are not passed to what is available behind. I don't know if this is just how X11 behaves, or it is a Qt bug that Qt windows consume input events whether or not the application itself used/consumed them.

Screenshots from the active state:

Without !7248 (merged), current margin (20):

csd-shadow-20-glow

Without !7248 (merged), icreased margin (40), this merge request:

csd-shadow-40-glow.png

With !7248 (merged), current margin (20):

csd-shadow-20-shadow.png

With !7248 (merged), icreased margin (40), this merge request:

csd-shadow-40-shadow.png

I'm open to suggestions if we should use even higher margin, as it seems on Wayland it does not have any negative side effect (I tried to explain how above).

I did not care about Windows because there the platform handles the shadows with CSD.

Request review @chub.

Merge request reports

Loading