Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #927. Shadows are disabled by default and can be enabled on the
layout {}
or in a window rule.@timgott want to take a glance just in case? I more or less followed your advice.
Everyone else: please give it a try. I'm looking for feedback:
I checked what options and defaults other implementations have (wayfire-shadows, swayfx, hyprland, fht) and arrived at the system in this PR.
width
,spread
,offset
andcolor
mean the same thing as in CSS box-shadow. The default width of 30 is slightly lower than in wayfire-shadows and swayfx (44 and 40 respectively, converted to niri units), but we have a slight default spread of 5.I set
draw-behind-window
totrue
by default because otherwise CSD rounded corners will look broken. However, withdraw-behind-window false
, niri will fully respect its own rounded corners (geometry-corner-radius
) with no artifacts.There's no "only floating" setting because you can window-rule it.
Contrary to other implementations, I decided to slightly reduce the shadow opacity for inactive windows. This is how CSD shadows usually work and I think it makes sense.
Niri shadows render below the border and focus ring, in contrast to CSD shadows that render above the border and focus ring.