diff options
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 7bd1fe3e..9e40a3b4 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -206,9 +206,17 @@ static void container_move_to_workspace(struct sway_container *container, | |||
206 | container_detach(container); | 206 | container_detach(container); |
207 | workspace_add_floating(workspace, container); | 207 | workspace_add_floating(workspace, container); |
208 | container_handle_fullscreen_reparent(container); | 208 | container_handle_fullscreen_reparent(container); |
209 | // If changing output, center it within the workspace | 209 | // If changing output, adjust the coordinates of the window. |
210 | if (old_output != workspace->output && !container->pending.fullscreen_mode) { | 210 | if (old_output != workspace->output && !container->pending.fullscreen_mode) { |
211 | container_floating_move_to_center(container); | 211 | struct wlr_box workspace_box, old_workspace_box; |
212 | workspace_get_box(workspace, &workspace_box); | ||
213 | workspace_get_box(old_workspace, &old_workspace_box); | ||
214 | floating_fix_coordinates(container, &old_workspace_box, &workspace_box); | ||
215 | if (container->scratchpad && workspace->output) { | ||
216 | struct wlr_box output_box; | ||
217 | output_get_box(workspace->output, &output_box); | ||
218 | container->transform = workspace_box; | ||
219 | } | ||
212 | } | 220 | } |
213 | } else { | 221 | } else { |
214 | container_detach(container); | 222 | container_detach(container); |