summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2024-06-01 06:24:08 +0200
committerGitHub <[email protected]>2024-06-01 00:24:08 -0400
commitda559b3ea13addecdd7747b99f3ed498f991d031 (patch)
tree8d295ffdc452998e7cca746d1487b3c8d696cff8
parent3c621dec7d653231f960d377fcb3ceeed55953e2 (diff)
Fixed blurred tiling indicator not drawing on the right coordinates (#319)
-rw-r--r--sway/input/seatop_move_tiling.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c
index bbed01a8..a8cc5f75 100644
--- a/sway/input/seatop_move_tiling.c
+++ b/sway/input/seatop_move_tiling.c
@@ -45,17 +45,27 @@ static void handle_render(struct sway_seat *seat, struct fx_render_context *ctx)
memcpy(&box, &e->drop_box, sizeof(struct wlr_box));
scale_box(&box, ctx->output->wlr_output->scale);
- // Render blur
- pixman_region32_t opaque_region;
- pixman_region32_init(&opaque_region);
struct decoration_data deco_data = get_undecorated_decoration_data();
deco_data.blur = e->con->blur_enabled;
- deco_data.corner_radius = e->con->corner_radius;
- struct wlr_fbox src_box = {0};
- render_blur(ctx, NULL, &src_box, &box, false, &opaque_region, deco_data);
- pixman_region32_fini(&opaque_region);
+ deco_data.corner_radius = e->con->corner_radius * ctx->output->wlr_output->scale;
+
+ // Render blur
+ if (deco_data.blur && color[3] < 1.0f) {
+ pixman_region32_t opaque_region;
+ pixman_region32_init(&opaque_region);
+ struct wlr_fbox src_box = {0};
+ struct wlr_box blur_box;
+ memcpy(&blur_box, &e->drop_box, sizeof(struct wlr_box));
+ // The render_blur function doesn't use root-relative coordinates
+ blur_box.x -= ctx->output->lx;
+ blur_box.y -= ctx->output->ly;
+ scale_box(&blur_box, ctx->output->wlr_output->scale);
+
+ render_blur(ctx, NULL, &src_box, &blur_box, false, &opaque_region, deco_data);
+ pixman_region32_fini(&opaque_region);
+ }
- render_rounded_rect(ctx, &box, color, e->con->corner_radius * ctx->output->wlr_output->scale, ALL);
+ render_rounded_rect(ctx, &box, color, deco_data.corner_radius, ALL);
}
}