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_floating.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_floating.c')
-rw-r--r-- | sway/input/seatop_resize_floating.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index 78dfe29f..8400a4b3 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c @@ -118,21 +118,21 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { // Determine the amounts we need to bump everything relative to the current // size. - int relative_grow_width = width - con->width; - int relative_grow_height = height - con->height; - int relative_grow_x = (e->ref_con_lx + grow_x) - con->x; - int relative_grow_y = (e->ref_con_ly + grow_y) - con->y; + int relative_grow_width = width - con->pending.width; + int relative_grow_height = height - con->pending.height; + int relative_grow_x = (e->ref_con_lx + grow_x) - con->pending.x; + int relative_grow_y = (e->ref_con_ly + grow_y) - con->pending.y; // Actually resize stuff - con->x += relative_grow_x; - con->y += relative_grow_y; - con->width += relative_grow_width; - con->height += relative_grow_height; + con->pending.x += relative_grow_x; + con->pending.y += relative_grow_y; + con->pending.width += relative_grow_width; + con->pending.height += relative_grow_height; - con->content_x += relative_grow_x; - con->content_y += relative_grow_y; - con->content_width += relative_grow_width; - con->content_height += relative_grow_height; + con->pending.content_x += relative_grow_x; + con->pending.content_y += relative_grow_y; + con->pending.content_width += relative_grow_width; + con->pending.content_height += relative_grow_height; arrange_container(con); transaction_commit_dirty(); @@ -169,10 +169,10 @@ void seatop_begin_resize_floating(struct sway_seat *seat, e->edge = edge == WLR_EDGE_NONE ? WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT : edge; e->ref_lx = seat->cursor->cursor->x; e->ref_ly = seat->cursor->cursor->y; - e->ref_con_lx = con->x; - e->ref_con_ly = con->y; - e->ref_width = con->width; - e->ref_height = con->height; + e->ref_con_lx = con->pending.x; + e->ref_con_ly = con->pending.y; + e->ref_width = con->pending.width; + e->ref_height = con->pending.height; seat->seatop_impl = &seatop_impl; seat->seatop_data = e; |