diff options
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r-- | sway/tree/root.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index c7c5e1df..a9d306a4 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c | |||
@@ -61,9 +61,14 @@ void root_scratchpad_add_container(struct sway_container *con) { | |||
61 | 61 | ||
62 | struct sway_container *parent = con->parent; | 62 | struct sway_container *parent = con->parent; |
63 | struct sway_workspace *workspace = con->workspace; | 63 | struct sway_workspace *workspace = con->workspace; |
64 | container_set_floating(con, true); | 64 | |
65 | container_floating_set_default_size(con); | 65 | // When a tiled window is sent to scratchpad, center and resize it. |
66 | container_floating_move_to_center(con); | 66 | if (!container_is_floating(con)) { |
67 | container_set_floating(con, true); | ||
68 | container_floating_set_default_size(con); | ||
69 | container_floating_move_to_center(con); | ||
70 | } | ||
71 | |||
67 | container_detach(con); | 72 | container_detach(con); |
68 | con->scratchpad = true; | 73 | con->scratchpad = true; |
69 | list_add(root->scratchpad, con); | 74 | list_add(root->scratchpad, con); |