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

Add blur, shadow, and corner radius to layer-shell surfaces #144

Merged
merged 40 commits into from
May 19, 2023

Conversation

ErikReider
Copy link
Collaborator

@ErikReider ErikReider commented Apr 19, 2023

Adds border radius and blur to layer-shell surfaces (not background and bottom layers).

Requires #157

Todo:

  • Command to add layer namespace with effects

  • Handle blur

  • Handle shadow

  • Handle corner radius

  • Add layer-effect checking in get_workspace_effect_info

  • Change config command syntax to match for_window

  • Add method of viewing all layer namespaces in sway-ipc

  • Make the command syntax similar to for_window

  • Code cleanup (change the config syntax?)

  • Disable blur xray for bottom layer surfaces

image

Example command:
layer_effects "waybar" blur enable; shadows enable; corner_radius 6

@ErikReider ErikReider changed the title [WIP] Initial toplevel effects Add blur and corner radius to layer-shell surfaces Apr 21, 2023
@ErikReider ErikReider self-assigned this Apr 21, 2023
@ErikReider ErikReider added the enhancement New feature or request label Apr 21, 2023
@ErikReider ErikReider marked this pull request as ready for review April 21, 2023 22:20
@ErikReider
Copy link
Collaborator Author

ErikReider commented Apr 21, 2023

I skipped adding shadows due to them only being rendered for the base surface. Would be easier if we render shadows in render_surface_iterator. Shadows could be moved into there in this commit if desired :)

Other than that and the discussion todos, this should be ready

Edit: I added support for shadows and it works really well so let me know if it's something better suited for a separate PR

@ErikReider
Copy link
Collaborator Author

Seems like moving the shadows into render_surface_iterator fixes #141 :)

@WillPower3309 WillPower3309 changed the title Add blur and corner radius to layer-shell surfaces Add blur, shadow, and corner radius to layer-shell surfaces Apr 23, 2023
README.md Outdated Show resolved Hide resolved
@WillPower3309 WillPower3309 added this to the 0.3 milestone Apr 24, 2023
Better checks if the layer surface is a subsurface or not and only renders the shadows
in the render_surface_iterator if said pointer isn't NULL
Now supports commands like these:

```
layer_effects "waybar" {
  blur enable;
  shadows disable;
  corner_radius 6;
}
```

Also now able to override previous criterias and add criterias during runtime
@WillPower3309
Copy link
Owner

WillPower3309 commented May 16, 2023

Will need a hefty rebase with #155 merged

@ErikReider
Copy link
Collaborator Author

Will need a hefty rebase with #155 merged

I'm on it! o7

Copy link
Owner

@WillPower3309 WillPower3309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few questions / comments

include/sway/desktop/fx_renderer/fx_renderer.h Outdated Show resolved Hide resolved
include/sway/desktop/fx_renderer/fx_renderer.h Outdated Show resolved Hide resolved
sway/commands/blur.c Outdated Show resolved Hide resolved
@WillPower3309
Copy link
Owner

Rebased + made some changes so we aren't rendering shadows in the surface iterator, and some minor refactors

@WillPower3309
Copy link
Owner

We do lose xray for layer shell popups here, but if they're really needed we can look into returning that functionality

Copy link
Owner

@WillPower3309 WillPower3309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to look into, but otherwise looks good! I won't have capacity to look into it until this evening

sway/desktop/output.c Show resolved Hide resolved
@ErikReider ErikReider merged commit 415e072 into master May 19, 2023
@ErikReider ErikReider deleted the toplevel-effects branch May 19, 2023 19:14
WillPower3309 added a commit that referenced this pull request Jul 24, 2023
Co-authored-by: Will McKinnon <contact@willmckinnon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants