diff options
author | Erik Reider <[email protected]> | 2023-05-19 21:14:06 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-19 21:14:06 +0200 |
commit | 415e072a3af292937f0b4c41acadafaee6958437 (patch) | |
tree | 354de329d9cbf66054260d50aebefd86a26d5055 /sway/tree/workspace.c | |
parent | 67078429428f0a97333c107da8a3ad8fb678a602 (diff) |
Add blur, shadow, and corner radius to layer-shell surfaces (#144)
Co-authored-by: Will McKinnon <[email protected]>
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 161b1e9c..8bc62f3f 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -5,11 +5,13 @@ #include <stdlib.h> #include <stdio.h> #include <strings.h> +#include <wayland-util.h> #include "stringop.h" #include "sway/input/input-manager.h" #include "sway/input/cursor.h" #include "sway/input/seat.h" #include "sway/ipc-server.h" +#include "sway/layers.h" #include "sway/output.h" #include "sway/tree/arrange.h" #include "sway/tree/container.h" @@ -702,7 +704,25 @@ bool should_workspace_have_blur(struct sway_workspace *ws) { if (!workspace_is_visible(ws)) { return false; } - return (bool)workspace_find_container(ws, find_blurred_con_iterator, NULL); + + if ((bool)workspace_find_container(ws, find_blurred_con_iterator, NULL)) { + return true; + } + + // Check if any layer-shell surfaces will render effects + struct sway_output *sway_output = ws->output; + size_t len = sizeof(sway_output->layers) / sizeof(sway_output->layers[0]); + for (size_t i = 0; i < len; ++i) { + struct sway_layer_surface *lsurface; + wl_list_for_each(lsurface, &sway_output->layers[i], link) { + if (lsurface->has_blur && !lsurface->layer_surface->surface->opaque + && lsurface->layer != ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND) { + return true; + } + } + } + + return false; } void workspace_for_each_container(struct sway_workspace *ws, |