aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-23 11:36:16 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-23 11:36:16 +1000
commit64445f421452b841eb124f7f89e06084b05b1a54 (patch)
tree46b3bd642ce0e09a2a048fe85224494daec1a80c /sway/tree/workspace.c
parentMerge pull request #2688 from RyanDwyer/exec-commands-without-focus (diff)
downloadsway-64445f421452b841eb124f7f89e06084b05b1a54.tar.gz
sway-64445f421452b841eb124f7f89e06084b05b1a54.tar.zst
sway-64445f421452b841eb124f7f89e06084b05b1a54.zip
Prevent sticky containers from jumping on workspace switch
If you have swaybar docked to the top, and you create a floating sticky container and switch workspaces on the same output, the sticky container would move down by the height of swaybar on each switch. This happens because when creating the workspace we set the dimensions to the same as the output, then the subsequent arrange corrects it. During this arrange, floating containers are translated so they stay relative to the workspace. This translation needs to not occur for the initial arrange. This patch makes workspaces have a zero width and height when first created, so we can detect whether this is the initial arrange and avoid translating the floating containers if so.
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index b0c440c1..16031e87 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -54,10 +54,6 @@ struct sway_workspace *workspace_create(struct sway_output *output,
54 return NULL; 54 return NULL;
55 } 55 }
56 node_init(&ws->node, N_WORKSPACE, ws); 56 node_init(&ws->node, N_WORKSPACE, ws);
57 ws->x = output->lx;
58 ws->y = output->ly;
59 ws->width = output->width;
60 ws->height = output->height;
61 ws->name = name ? strdup(name) : NULL; 57 ws->name = name ? strdup(name) : NULL;
62 ws->prev_split_layout = L_NONE; 58 ws->prev_split_layout = L_NONE;
63 ws->layout = output_get_default_layout(output); 59 ws->layout = output_get_default_layout(output);