diff options
author | emersion <contact@emersion.fr> | 2018-09-23 09:42:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-23 09:42:07 +0200 |
commit | 4bc327a021121850d0c02d15ef9e784ff0f797bd (patch) | |
tree | 0b2c5fe7f09257660116f618f9e09d0d12e32888 /sway/tree/arrange.c | |
parent | 1af4d314d1873d823903bab72a79023e42221e1b (diff) | |
parent | 64445f421452b841eb124f7f89e06084b05b1a54 (diff) |
Merge pull request #2694 from RyanDwyer/fix-sticky-jumping-on-switch
Prevent sticky containers from jumping on workspace switch
Diffstat (limited to 'sway/tree/arrange.c')
-rw-r--r-- | sway/tree/arrange.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index d50be25d..373460a2 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c @@ -186,6 +186,7 @@ void arrange_workspace(struct sway_workspace *workspace) { area->width, area->height, area->x, area->y); workspace_remove_gaps(workspace); + bool first_arrange = workspace->width == 0 && workspace->height == 0; double prev_x = workspace->x; double prev_y = workspace->y; workspace->width = area->width; @@ -196,7 +197,7 @@ void arrange_workspace(struct sway_workspace *workspace) { // Adjust any floating containers double diff_x = workspace->x - prev_x; double diff_y = workspace->y - prev_y; - if (diff_x != 0 || diff_y != 0) { + if (!first_arrange && (diff_x != 0 || diff_y != 0)) { for (int i = 0; i < workspace->floating->length; ++i) { struct sway_container *floater = workspace->floating->items[i]; container_floating_translate(floater, diff_x, diff_y); |