Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement window shadows #990

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Implement window shadows #990

wants to merge 1 commit into from

Conversation

YaLTeR
Copy link
Owner

@YaLTeR YaLTeR commented Jan 16, 2025

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:

  • any graphical glitches?
  • any performance issues?
  • do the options and option names make sense? Anything that could be named better?
  • do the defaults make sense?

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 and color 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 to true by default because otherwise CSD rounded corners will look broken. However, with draw-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server-side window shadows
1 participant