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.
This commit is contained in:
Kenny Levinsen 2021-02-12 23:22:51 +01:00 committed by Tudor Brindus
parent 28cadf5580
commit a047b5ee4a
33 changed files with 723 additions and 757 deletions

View file

@ -15,7 +15,7 @@ static void finalize_move(struct sway_seat *seat) {
// We "move" the container to its own location
// so it discovers its output again.
container_floating_move_to(e->con, e->con->x, e->con->y);
container_floating_move_to(e->con, e->con->pending.x, e->con->pending.y);
transaction_commit_dirty();
seatop_begin_default(seat);
@ -70,8 +70,8 @@ void seatop_begin_move_floating(struct sway_seat *seat,
return;
}
e->con = con;
e->dx = cursor->cursor->x - con->x;
e->dy = cursor->cursor->y - con->y;
e->dx = cursor->cursor->x - con->pending.x;
e->dy = cursor->cursor->y - con->pending.y;
seat->seatop_impl = &seatop_impl;
seat->seatop_data = e;