diff options
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r-- | sway/tree/root.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index 5dde9f22..bc9c610d 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c | |||
@@ -124,15 +124,7 @@ void root_scratchpad_show(struct sway_container *con) { | |||
124 | struct wlr_box workspace_box; | 124 | struct wlr_box workspace_box; |
125 | workspace_get_box(new_ws, &workspace_box); | 125 | workspace_get_box(new_ws, &workspace_box); |
126 | if (!wlr_box_contains_point(&workspace_box, center_lx, center_ly)) { | 126 | if (!wlr_box_contains_point(&workspace_box, center_lx, center_ly)) { |
127 | // Maybe resize it | 127 | container_floating_resize_and_center(con); |
128 | if (con->width > new_ws->width || con->height > new_ws->height) { | ||
129 | container_init_floating(con); | ||
130 | } | ||
131 | |||
132 | // Center it | ||
133 | double new_lx = new_ws->x + (new_ws->width - con->width) / 2; | ||
134 | double new_ly = new_ws->y + (new_ws->height - con->height) / 2; | ||
135 | container_floating_move_to(con, new_lx, new_ly); | ||
136 | } | 128 | } |
137 | 129 | ||
138 | arrange_workspace(new_ws); | 130 | arrange_workspace(new_ws); |