diff options
author | Kenny Levinsen <[email protected]> | 2021-02-12 23:22:51 +0100 |
---|---|---|
committer | Tudor Brindus <[email protected]> | 2021-02-16 22:05:00 -0500 |
commit | a047b5ee4a2a67d30d93641ff86531d54b8e0879 (patch) | |
tree | 271666c6254e4fabf943c1153224059411a5ce56 /sway/input/seatop_resize_tiling.c | |
parent | 28cadf558090854ace1df1a0a64f5fbc059541c0 (diff) |
container: Move pending state to state struct
Pending state is currently inlined directly in the container struct,
while the current state is in a state struct. A side-effect of this is
that it is not immediately obvious that pending double-buffered state is
accessed, nor is it obvious what state is double-buffered.
Instead, use the state struct for both current and pending.
Diffstat (limited to 'sway/input/seatop_resize_tiling.c')
-rw-r--r-- | sway/input/seatop_resize_tiling.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index c5fe269e..869d11b5 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c @@ -53,19 +53,19 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, if (e->h_con) { container_set_resizing(e->h_con, false); container_set_resizing(e->h_sib, false); - if (e->h_con->parent) { - arrange_container(e->h_con->parent); + if (e->h_con->pending.parent) { + arrange_container(e->h_con->pending.parent); } else { - arrange_workspace(e->h_con->workspace); + arrange_workspace(e->h_con->pending.workspace); } } if (e->v_con) { container_set_resizing(e->v_con, false); container_set_resizing(e->v_sib, false); - if (e->v_con->parent) { - arrange_container(e->v_con->parent); + if (e->v_con->pending.parent) { + arrange_container(e->v_con->pending.parent); } else { - arrange_workspace(e->v_con->workspace); + arrange_workspace(e->v_con->pending.workspace); } } transaction_commit_dirty(); @@ -82,16 +82,16 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { if (e->h_con) { if (e->edge & WLR_EDGE_LEFT) { - amount_x = (e->h_con_orig_width - moved_x) - e->h_con->width; + amount_x = (e->h_con_orig_width - moved_x) - e->h_con->pending.width; } else if (e->edge & WLR_EDGE_RIGHT) { - amount_x = (e->h_con_orig_width + moved_x) - e->h_con->width; + amount_x = (e->h_con_orig_width + moved_x) - e->h_con->pending.width; } } if (e->v_con) { if (e->edge & WLR_EDGE_TOP) { - amount_y = (e->v_con_orig_height - moved_y) - e->v_con->height; + amount_y = (e->v_con_orig_height - moved_y) - e->v_con->pending.height; } else if (e->edge & WLR_EDGE_BOTTOM) { - amount_y = (e->v_con_orig_height + moved_y) - e->v_con->height; + amount_y = (e->v_con_orig_height + moved_y) - e->v_con->pending.height; } } @@ -143,7 +143,7 @@ void seatop_begin_resize_tiling(struct sway_seat *seat, if (e->h_con) { container_set_resizing(e->h_con, true); container_set_resizing(e->h_sib, true); - e->h_con_orig_width = e->h_con->width; + e->h_con_orig_width = e->h_con->pending.width; } } if (edge & (WLR_EDGE_TOP | WLR_EDGE_BOTTOM)) { @@ -154,7 +154,7 @@ void seatop_begin_resize_tiling(struct sway_seat *seat, if (e->v_con) { container_set_resizing(e->v_con, true); container_set_resizing(e->v_sib, true); - e->v_con_orig_height = e->v_con->height; + e->v_con_orig_height = e->v_con->pending.height; } } |