From a047b5ee4a2a67d30d93641ff86531d54b8e0879 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 12 Feb 2021 23:22:51 +0100 Subject: 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. --- sway/input/seatop_move_floating.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sway/input/seatop_move_floating.c') diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c index 6683be21..ddcd4c53 100644 --- a/sway/input/seatop_move_floating.c +++ b/sway/input/seatop_move_floating.c @@ -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; -- cgit v1.2.3