diff --git a/include/sway/desktop/fx_renderer/fx_renderer.h b/include/sway/desktop/fx_renderer/fx_renderer.h index 44e0429c..64e9e993 100644 --- a/include/sway/desktop/fx_renderer/fx_renderer.h +++ b/include/sway/desktop/fx_renderer/fx_renderer.h @@ -36,13 +36,6 @@ struct decoration_data { bool shadow; }; -struct fx_render_data { - pixman_region32_t *damage; - struct wlr_box *clip_box; - struct decoration_data deco_data; - bool is_toplevel_surface; -}; - struct gles2_tex_shader { GLuint program; GLint proj; diff --git a/include/sway/output.h b/include/sway/output.h index 65f7ca1a..3215c853 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -13,6 +13,12 @@ struct sway_server; struct sway_container; +struct render_data { + pixman_region32_t *damage; + struct wlr_box *clip_box; + struct decoration_data deco_data; +}; + struct sway_output_state { list_t *workspaces; struct sway_workspace *active_workspace; diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 8a9da029..03e45018 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -6,6 +6,7 @@ #include #include #include "log.h" +#include "sway/config.h" #include "sway/desktop/transaction.h" #include "sway/input/cursor.h" #include "sway/input/input-manager.h" @@ -15,6 +16,7 @@ #include "sway/server.h" #include "sway/tree/arrange.h" #include "sway/tree/workspace.h" +#include "wlr-layer-shell-unstable-v1-protocol.h" static void apply_exclusive(struct wlr_box *usable_area, uint32_t anchor, int32_t exclusive, @@ -686,7 +688,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { layer_surface->data = sway_layer; enum zwlr_layer_shell_v1_layer layer = layer_surface->current.layer; - if (layer != ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM && layer != ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND) { + if (layer != ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND) { for (int i = 0; i < config->layer_effects->length; ++i) { struct layer_effects *effect = config->layer_effects->items[i]; if (strcmp(effect->namespace, layer_surface->namespace) == 0) { diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 403e2dae..3b22bc79 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -199,7 +199,7 @@ void output_layer_for_each_toplevel_surface(struct sway_output *output, wl_list_for_each(layer_surface, layer_surfaces, link) { struct wlr_layer_surface_v1 *wlr_layer_surface_v1 = layer_surface->layer_surface; - struct fx_render_data *data = user_data; + struct render_data *data = user_data; struct layer_effects *effects = layer_surface->effects; if (effects) { data->deco_data.blur = effects->blur; diff --git a/sway/desktop/render.c b/sway/desktop/render.c index a2d66b52..8ac4ecdf 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -430,7 +430,7 @@ damage_finish: static void render_surface_iterator(struct sway_output *output, struct sway_view *view, struct wlr_surface *surface, struct wlr_box *_box, void *_data) { - struct fx_render_data *data = _data; + struct render_data *data = _data; struct wlr_output *wlr_output = output->wlr_output; pixman_region32_t *output_damage = data->damage; @@ -462,12 +462,9 @@ static void render_surface_iterator(struct sway_output *output, deco_data.corner_radius *= wlr_output->scale; // render blur (view->surface == surface excludes blurring subsurfaces) - bool is_subsurface = true; - bool should_optimize_blur = false; - if (data->is_toplevel_surface) { - is_subsurface = false; - should_optimize_blur = config->blur_xray; - } else if (view) { + bool is_subsurface = false; // TODO: discussion here, would all cases where view is null be a non subsurface? + bool should_optimize_blur = config->blur_xray; // TODO: for layershell bottom layer should be optimized + if (view) { is_subsurface = view->surface != surface; should_optimize_blur = !container_is_floating(view->container); } @@ -534,9 +531,8 @@ static void render_surface_iterator(struct sway_output *output, static void render_layer_toplevel(struct sway_output *output, pixman_region32_t *damage, struct wl_list *layer_surfaces) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = true, .deco_data = get_undecorated_decoration_data(), }; output_layer_for_each_toplevel_surface(output, layer_surfaces, @@ -545,9 +541,8 @@ static void render_layer_toplevel(struct sway_output *output, static void render_layer_popups(struct sway_output *output, pixman_region32_t *damage, struct wl_list *layer_surfaces) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = false, .deco_data = get_undecorated_decoration_data(), }; output_layer_for_each_popup_surface(output, layer_surfaces, @@ -557,9 +552,8 @@ static void render_layer_popups(struct sway_output *output, #if HAVE_XWAYLAND static void render_unmanaged(struct sway_output *output, pixman_region32_t *damage, struct wl_list *unmanaged) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = false, .deco_data = get_undecorated_decoration_data(), }; output_unmanaged_for_each_surface(output, unmanaged, @@ -569,9 +563,8 @@ static void render_unmanaged(struct sway_output *output, static void render_drag_icons(struct sway_output *output, pixman_region32_t *damage, struct wl_list *drag_icons) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = false, .deco_data = get_undecorated_decoration_data(), }; output_drag_icons_for_each_surface(output, drag_icons, @@ -766,9 +759,8 @@ void premultiply_alpha(float color[4], float opacity) { static void render_view_toplevels(struct sway_view *view, struct sway_output *output, pixman_region32_t *damage, struct decoration_data deco_data) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = false, .deco_data = deco_data, }; // Clip the window to its view size, ignoring CSD @@ -792,9 +784,8 @@ static void render_view_toplevels(struct sway_view *view, struct sway_output *ou static void render_view_popups(struct sway_view *view, struct sway_output *output, pixman_region32_t *damage, struct decoration_data deco_data) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = false, .deco_data = deco_data, }; output_view_for_each_popup_surface(output, view, @@ -1992,9 +1983,8 @@ void output_render(struct sway_output *output, struct timespec *when, } if (server.session_lock.lock != NULL) { - struct fx_render_data data = { + struct render_data data = { .damage = damage, - .is_toplevel_surface = false, .deco_data = get_undecorated_decoration_data(), };