diff --git a/flake.lock b/flake.lock index 0fb8f1a2..2c645ce5 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -18,11 +18,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1673947312, - "narHash": "sha256-xx/2nRwRy3bXrtry6TtydKpJpqHahjuDB5sFkQ/XNDE=", + "lastModified": 1683048793, + "narHash": "sha256-XA1Y70qnX08eAYFfq4k9L1Bdu37+zm28B32w7d+155o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d38b664b4400335086a713a0036aafaa002c003", + "rev": "e4ad893057db74091ed0e3edf509a72fb83051df", "type": "github" }, "original": { diff --git a/sway/desktop/render.c b/sway/desktop/render.c index e7f28692..c1a02467 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -493,7 +493,7 @@ static void render_surface_iterator(struct sway_output *output, wlr_output); // render shadow (view->surface == surface excludes shadow on subsurfaces) - if (deco_data.shadow && should_parameters_shadow() && !is_subsurface) { + if (deco_data.shadow && should_parameters_shadow() && !is_subsurface && !view) { int corner_radius = deco_data.corner_radius; if (view) { struct sway_container *con = view->container; @@ -862,15 +862,6 @@ static void render_saved_view(struct sway_view *view, struct sway_output *output struct fx_texture fx_texture = fx_texture_from_wlr_texture(saved_buf->buffer->texture); render_texture(wlr_output, damage, &fx_texture, &saved_buf->source_box, &dst_box, matrix, deco_data); - - // render shadow - if (deco_data.shadow && should_parameters_shadow() - // Only draw shadows on CSD windows if shadows_on_csd is enabled - && !(con->current.border == B_CSD && !config->shadows_on_csd_enabled)) { - int corner_radius = (con->corner_radius + state.border_thickness) * wlr_output->scale; - render_box_shadow(output, damage, &dst_box, config->shadow_color, - config->shadow_blur_sigma, corner_radius); - } } // FIXME: we should set the surface that this saved buffer originates from @@ -894,12 +885,30 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, render_view_toplevels(view, output, damage, deco_data); } - if (state->border == B_NONE || state->border == B_CSD) { + if (state->border == B_CSD && !config->shadows_on_csd_enabled) { return; } float output_scale = output->wlr_output->scale; struct wlr_box box; + + // render shadow + if (con->shadow_enabled && config->shadow_blur_sigma > 0 && config->shadow_color[3] > 0.0) { + box.x = floor(state->x) - output->lx; + box.y = floor(state->y) - output->ly; + box.width = state->width; + box.height = state->height; + scale_box(&box, output_scale); + int scaled_corner_radius = deco_data.corner_radius == 0 ? + 0 : (deco_data.corner_radius + state->border_thickness) * output_scale; + render_box_shadow(output, damage, &box, config->shadow_color, config->shadow_blur_sigma, + scaled_corner_radius); + } + + if (state->border == B_NONE || state->border == B_CSD) { + return; + } + float color[4]; if (state->border_left) {