mirror of
https://github.com/swaywm/sway.git
synced 2026-04-03 07:15:39 -04:00
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:
parent
28cadf5580
commit
a047b5ee4a
33 changed files with 723 additions and 757 deletions
|
|
@ -70,13 +70,13 @@ static void restore_workspaces(struct sway_output *output) {
|
|||
// floater re-centered
|
||||
for (int i = 0; i < ws->floating->length; i++) {
|
||||
struct sway_container *floater = ws->floating->items[i];
|
||||
if (floater->width == 0 || floater->height == 0 ||
|
||||
floater->width > output->width ||
|
||||
floater->height > output->height ||
|
||||
floater->x > output->lx + output->width ||
|
||||
floater->y > output->ly + output->height ||
|
||||
floater->x + floater->width < output->lx ||
|
||||
floater->y + floater->height < output->ly) {
|
||||
if (floater->pending.width == 0 || floater->pending.height == 0 ||
|
||||
floater->pending.width > output->width ||
|
||||
floater->pending.height > output->height ||
|
||||
floater->pending.x > output->lx + output->width ||
|
||||
floater->pending.y > output->ly + output->height ||
|
||||
floater->pending.x + floater->pending.width < output->lx ||
|
||||
floater->pending.y + floater->pending.height < output->ly) {
|
||||
container_floating_resize_and_center(floater);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue