diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-04-27 11:19:58 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-05-02 18:31:55 +0200 |
commit | d5cc474aef6bf5a23694053ab9c8770ea3f21e6f (patch) | |
tree | 9bead7ab099de9675204d82ae397746cec232ff8 /sway/input/seatop_move_tiling.c | |
parent | xdg_shell: Fix crash if popup generates while toplevel is in the scratchpad (diff) | |
download | sway-d5cc474aef6bf5a23694053ab9c8770ea3f21e6f.tar.gz sway-d5cc474aef6bf5a23694053ab9c8770ea3f21e6f.tar.zst sway-d5cc474aef6bf5a23694053ab9c8770ea3f21e6f.zip |
render: pass rendering state together in a struct
This lets us easily add rendering state that we need in the future
Diffstat (limited to 'sway/input/seatop_move_tiling.c')
-rw-r--r-- | sway/input/seatop_move_tiling.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c index 5498e909..26704d0d 100644 --- a/sway/input/seatop_move_tiling.c +++ b/sway/input/seatop_move_tiling.c | |||
@@ -31,21 +31,20 @@ struct seatop_move_tiling_event { | |||
31 | bool insert_after_target; | 31 | bool insert_after_target; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | static void handle_render(struct sway_seat *seat, | 34 | static void handle_render(struct sway_seat *seat, struct render_context *ctx) { |
35 | struct sway_output *output, const pixman_region32_t *damage) { | ||
36 | struct seatop_move_tiling_event *e = seat->seatop_data; | 35 | struct seatop_move_tiling_event *e = seat->seatop_data; |
37 | if (!e->threshold_reached) { | 36 | if (!e->threshold_reached) { |
38 | return; | 37 | return; |
39 | } | 38 | } |
40 | if (e->target_node && node_get_output(e->target_node) == output) { | 39 | if (e->target_node && node_get_output(e->target_node) == ctx->output) { |
41 | float color[4]; | 40 | float color[4]; |
42 | memcpy(&color, config->border_colors.focused.indicator, | 41 | memcpy(&color, config->border_colors.focused.indicator, |
43 | sizeof(float) * 4); | 42 | sizeof(float) * 4); |
44 | premultiply_alpha(color, 0.5); | 43 | premultiply_alpha(color, 0.5); |
45 | struct wlr_box box; | 44 | struct wlr_box box; |
46 | memcpy(&box, &e->drop_box, sizeof(struct wlr_box)); | 45 | memcpy(&box, &e->drop_box, sizeof(struct wlr_box)); |
47 | scale_box(&box, output->wlr_output->scale); | 46 | scale_box(&box, ctx->output->wlr_output->scale); |
48 | render_rect(output, damage, &box, color); | 47 | render_rect(ctx, &box, color); |
49 | } | 48 | } |
50 | } | 49 | } |
51 | 50 | ||