diff options
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index f8f89f18..f2702fa1 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -113,8 +113,8 @@ static void container_move_to_container_from_direction( | |||
113 | struct sway_container *container, struct sway_container *destination, | 113 | struct sway_container *container, struct sway_container *destination, |
114 | enum wlr_direction move_dir) { | 114 | enum wlr_direction move_dir) { |
115 | if (destination->view) { | 115 | if (destination->view) { |
116 | if (destination->parent == container->parent && | 116 | if (destination->pending.parent == container->pending.parent && |
117 | destination->workspace == container->workspace) { | 117 | destination->pending.workspace == container->pending.workspace) { |
118 | sway_log(SWAY_DEBUG, "Swapping siblings"); | 118 | sway_log(SWAY_DEBUG, "Swapping siblings"); |
119 | list_t *siblings = container_get_siblings(container); | 119 | list_t *siblings = container_get_siblings(container); |
120 | int container_index = list_find(siblings, container); | 120 | int container_index = list_find(siblings, container); |
@@ -126,28 +126,28 @@ static void container_move_to_container_from_direction( | |||
126 | int offset = | 126 | int offset = |
127 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP; | 127 | move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP; |
128 | int index = container_sibling_index(destination) + offset; | 128 | int index = container_sibling_index(destination) + offset; |
129 | if (destination->parent) { | 129 | if (destination->pending.parent) { |
130 | container_insert_child(destination->parent, container, index); | 130 | container_insert_child(destination->pending.parent, container, index); |
131 | } else { | 131 | } else { |
132 | workspace_insert_tiling(destination->workspace, | 132 | workspace_insert_tiling(destination->pending.workspace, |
133 | container, index); | 133 | container, index); |
134 | } | 134 | } |
135 | container->width = container->height = 0; | 135 | container->pending.width = container->pending.height = 0; |
136 | container->width_fraction = container->height_fraction = 0; | 136 | container->width_fraction = container->height_fraction = 0; |
137 | workspace_squash(destination->workspace); | 137 | workspace_squash(destination->pending.workspace); |
138 | } | 138 | } |
139 | return; | 139 | return; |
140 | } | 140 | } |
141 | 141 | ||
142 | if (is_parallel(destination->layout, move_dir)) { | 142 | if (is_parallel(destination->pending.layout, move_dir)) { |
143 | sway_log(SWAY_DEBUG, "Reparenting container (parallel)"); | 143 | sway_log(SWAY_DEBUG, "Reparenting container (parallel)"); |
144 | int index = | 144 | int index = |
145 | move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? | 145 | move_dir == WLR_DIRECTION_RIGHT || move_dir == WLR_DIRECTION_DOWN ? |
146 | 0 : destination->children->length; | 146 | 0 : destination->pending.children->length; |
147 | container_insert_child(destination, container, index); | 147 | container_insert_child(destination, container, index); |
148 | container->width = container->height = 0; | 148 | container->pending.width = container->pending.height = 0; |
149 | container->width_fraction = container->height_fraction = 0; | 149 | container->width_fraction = container->height_fraction = 0; |
150 | workspace_squash(destination->workspace); | 150 | workspace_squash(destination->pending.workspace); |
151 | return; | 151 | return; |
152 | } | 152 | } |
153 | 153 | ||
@@ -168,7 +168,7 @@ static void container_move_to_container_from_direction( | |||
168 | static void container_move_to_workspace_from_direction( | 168 | static void container_move_to_workspace_from_direction( |
169 | struct sway_container *container, struct sway_workspace *workspace, | 169 | struct sway_container *container, struct sway_workspace *workspace, |
170 | enum wlr_direction move_dir) { | 170 | enum wlr_direction move_dir) { |
171 | container->width = container->height = 0; | 171 | container->pending.width = container->pending.height = 0; |
172 | container->width_fraction = container->height_fraction = 0; | 172 | container->width_fraction = container->height_fraction = 0; |
173 | 173 | ||
174 | if (is_parallel(workspace->layout, move_dir)) { | 174 | if (is_parallel(workspace->layout, move_dir)) { |
@@ -188,8 +188,8 @@ static void container_move_to_workspace_from_direction( | |||
188 | workspace_add_tiling(workspace, container); | 188 | workspace_add_tiling(workspace, container); |
189 | return; | 189 | return; |
190 | } | 190 | } |
191 | while (focus_inactive->parent) { | 191 | while (focus_inactive->pending.parent) { |
192 | focus_inactive = focus_inactive->parent; | 192 | focus_inactive = focus_inactive->pending.parent; |
193 | } | 193 | } |
194 | container_move_to_container_from_direction(container, focus_inactive, | 194 | container_move_to_container_from_direction(container, focus_inactive, |
195 | move_dir); | 195 | move_dir); |
@@ -197,25 +197,25 @@ static void container_move_to_workspace_from_direction( | |||
197 | 197 | ||
198 | static void container_move_to_workspace(struct sway_container *container, | 198 | static void container_move_to_workspace(struct sway_container *container, |
199 | struct sway_workspace *workspace) { | 199 | struct sway_workspace *workspace) { |
200 | if (container->workspace == workspace) { | 200 | if (container->pending.workspace == workspace) { |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | struct sway_workspace *old_workspace = container->workspace; | 203 | struct sway_workspace *old_workspace = container->pending.workspace; |
204 | if (container_is_floating(container)) { | 204 | if (container_is_floating(container)) { |
205 | struct sway_output *old_output = container->workspace->output; | 205 | struct sway_output *old_output = container->pending.workspace->output; |
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, center it within the workspace |
210 | if (old_output != workspace->output && !container->fullscreen_mode) { | 210 | if (old_output != workspace->output && !container->pending.fullscreen_mode) { |
211 | container_floating_move_to_center(container); | 211 | container_floating_move_to_center(container); |
212 | } | 212 | } |
213 | } else { | 213 | } else { |
214 | container_detach(container); | 214 | container_detach(container); |
215 | if (workspace_is_empty(workspace) && container->children) { | 215 | if (workspace_is_empty(workspace) && container->pending.children) { |
216 | workspace_unwrap_children(workspace, container); | 216 | workspace_unwrap_children(workspace, container); |
217 | } else { | 217 | } else { |
218 | container->width = container->height = 0; | 218 | container->pending.width = container->pending.height = 0; |
219 | container->width_fraction = container->height_fraction = 0; | 219 | container->width_fraction = container->height_fraction = 0; |
220 | workspace_add_tiling(workspace, container); | 220 | workspace_add_tiling(workspace, container); |
221 | } | 221 | } |
@@ -237,13 +237,13 @@ static void container_move_to_container(struct sway_container *container, | |||
237 | return; | 237 | return; |
238 | } | 238 | } |
239 | if (container_is_floating(container)) { | 239 | if (container_is_floating(container)) { |
240 | container_move_to_workspace(container, destination->workspace); | 240 | container_move_to_workspace(container, destination->pending.workspace); |
241 | return; | 241 | return; |
242 | } | 242 | } |
243 | struct sway_workspace *old_workspace = container->workspace; | 243 | struct sway_workspace *old_workspace = container->pending.workspace; |
244 | 244 | ||
245 | container_detach(container); | 245 | container_detach(container); |
246 | container->width = container->height = 0; | 246 | container->pending.width = container->pending.height = 0; |
247 | container->width_fraction = container->height_fraction = 0; | 247 | container->width_fraction = container->height_fraction = 0; |
248 | 248 | ||
249 | if (destination->view) { | 249 | if (destination->view) { |
@@ -256,12 +256,12 @@ static void container_move_to_container(struct sway_container *container, | |||
256 | ipc_event_window(container, "move"); | 256 | ipc_event_window(container, "move"); |
257 | } | 257 | } |
258 | 258 | ||
259 | if (destination->workspace) { | 259 | if (destination->pending.workspace) { |
260 | workspace_focus_fullscreen(destination->workspace); | 260 | workspace_focus_fullscreen(destination->pending.workspace); |
261 | workspace_detect_urgent(destination->workspace); | 261 | workspace_detect_urgent(destination->pending.workspace); |
262 | } | 262 | } |
263 | 263 | ||
264 | if (old_workspace && old_workspace != destination->workspace) { | 264 | if (old_workspace && old_workspace != destination->pending.workspace) { |
265 | workspace_detect_urgent(old_workspace); | 265 | workspace_detect_urgent(old_workspace); |
266 | } | 266 | } |
267 | } | 267 | } |
@@ -275,7 +275,7 @@ static bool container_move_to_next_output(struct sway_container *container, | |||
275 | if (!sway_assert(ws, "Expected output to have a workspace")) { | 275 | if (!sway_assert(ws, "Expected output to have a workspace")) { |
276 | return false; | 276 | return false; |
277 | } | 277 | } |
278 | switch (container->fullscreen_mode) { | 278 | switch (container->pending.fullscreen_mode) { |
279 | case FULLSCREEN_NONE: | 279 | case FULLSCREEN_NONE: |
280 | container_move_to_workspace_from_direction(container, ws, move_dir); | 280 | container_move_to_workspace_from_direction(container, ws, move_dir); |
281 | return true; | 281 | return true; |
@@ -293,12 +293,12 @@ static bool container_move_to_next_output(struct sway_container *container, | |||
293 | static bool container_move_in_direction(struct sway_container *container, | 293 | static bool container_move_in_direction(struct sway_container *container, |
294 | enum wlr_direction move_dir) { | 294 | enum wlr_direction move_dir) { |
295 | // If moving a fullscreen view, only consider outputs | 295 | // If moving a fullscreen view, only consider outputs |
296 | switch (container->fullscreen_mode) { | 296 | switch (container->pending.fullscreen_mode) { |
297 | case FULLSCREEN_NONE: | 297 | case FULLSCREEN_NONE: |
298 | break; | 298 | break; |
299 | case FULLSCREEN_WORKSPACE: | 299 | case FULLSCREEN_WORKSPACE: |
300 | return container_move_to_next_output(container, | 300 | return container_move_to_next_output(container, |
301 | container->workspace->output, move_dir); | 301 | container->pending.workspace->output, move_dir); |
302 | case FULLSCREEN_GLOBAL: | 302 | case FULLSCREEN_GLOBAL: |
303 | return false; | 303 | return false; |
304 | } | 304 | } |
@@ -317,26 +317,26 @@ static bool container_move_in_direction(struct sway_container *container, | |||
317 | while (!ancestor) { | 317 | while (!ancestor) { |
318 | // Don't allow containers to move out of their | 318 | // Don't allow containers to move out of their |
319 | // fullscreen or floating parent | 319 | // fullscreen or floating parent |
320 | if (current->fullscreen_mode || container_is_floating(current)) { | 320 | if (current->pending.fullscreen_mode || container_is_floating(current)) { |
321 | return false; | 321 | return false; |
322 | } | 322 | } |
323 | 323 | ||
324 | enum sway_container_layout parent_layout = container_parent_layout(current); | 324 | enum sway_container_layout parent_layout = container_parent_layout(current); |
325 | if (!is_parallel(parent_layout, move_dir)) { | 325 | if (!is_parallel(parent_layout, move_dir)) { |
326 | if (!current->parent) { | 326 | if (!current->pending.parent) { |
327 | // No parallel parent, so we reorient the workspace | 327 | // No parallel parent, so we reorient the workspace |
328 | current = workspace_wrap_children(current->workspace); | 328 | current = workspace_wrap_children(current->pending.workspace); |
329 | current->workspace->layout = | 329 | current->pending.workspace->layout = |
330 | move_dir == WLR_DIRECTION_LEFT || | 330 | move_dir == WLR_DIRECTION_LEFT || |
331 | move_dir == WLR_DIRECTION_RIGHT ? | 331 | move_dir == WLR_DIRECTION_RIGHT ? |
332 | L_HORIZ : L_VERT; | 332 | L_HORIZ : L_VERT; |
333 | container->height = container->width = 0; | 333 | container->pending.height = container->pending.width = 0; |
334 | container->height_fraction = container->width_fraction = 0; | 334 | container->height_fraction = container->width_fraction = 0; |
335 | workspace_update_representation(current->workspace); | 335 | workspace_update_representation(current->pending.workspace); |
336 | wrapped = true; | 336 | wrapped = true; |
337 | } else { | 337 | } else { |
338 | // Keep looking for a parallel parent | 338 | // Keep looking for a parallel parent |
339 | current = current->parent; | 339 | current = current->pending.parent; |
340 | } | 340 | } |
341 | continue; | 341 | continue; |
342 | } | 342 | } |
@@ -356,14 +356,14 @@ static bool container_move_in_direction(struct sway_container *container, | |||
356 | container_move_to_container_from_direction(container, | 356 | container_move_to_container_from_direction(container, |
357 | target, move_dir); | 357 | target, move_dir); |
358 | return true; | 358 | return true; |
359 | } else if (!container->parent) { | 359 | } else if (!container->pending.parent) { |
360 | // Container is at workspace level so we move it to the | 360 | // Container is at workspace level so we move it to the |
361 | // next workspace if possible | 361 | // next workspace if possible |
362 | return container_move_to_next_output(container, | 362 | return container_move_to_next_output(container, |
363 | current->workspace->output, move_dir); | 363 | current->pending.workspace->output, move_dir); |
364 | } else { | 364 | } else { |
365 | // Container has escaped its immediate parallel parent | 365 | // Container has escaped its immediate parallel parent |
366 | current = current->parent; | 366 | current = current->pending.parent; |
367 | continue; | 367 | continue; |
368 | } | 368 | } |
369 | } | 369 | } |
@@ -377,31 +377,31 @@ static bool container_move_in_direction(struct sway_container *container, | |||
377 | container_move_to_container_from_direction(container, | 377 | container_move_to_container_from_direction(container, |
378 | target, move_dir); | 378 | target, move_dir); |
379 | return true; | 379 | return true; |
380 | } else if (!wrapped && !container->parent->parent && | 380 | } else if (!wrapped && !container->pending.parent->pending.parent && |
381 | container->parent->children->length == 1) { | 381 | container->pending.parent->pending.children->length == 1) { |
382 | // Treat singleton children as if they are at workspace level like i3 | 382 | // Treat singleton children as if they are at workspace level like i3 |
383 | // https://github.com/i3/i3/blob/1d9160f2d247dbaa83fb62f02fd7041dec767fc2/src/move.c#L367 | 383 | // https://github.com/i3/i3/blob/1d9160f2d247dbaa83fb62f02fd7041dec767fc2/src/move.c#L367 |
384 | return container_move_to_next_output(container, | 384 | return container_move_to_next_output(container, |
385 | ancestor->workspace->output, move_dir); | 385 | ancestor->pending.workspace->output, move_dir); |
386 | } else { | 386 | } else { |
387 | // Container will be promoted | 387 | // Container will be promoted |
388 | struct sway_container *old_parent = container->parent; | 388 | struct sway_container *old_parent = container->pending.parent; |
389 | if (ancestor->parent) { | 389 | if (ancestor->pending.parent) { |
390 | // Container will move in with its parent | 390 | // Container will move in with its parent |
391 | container_insert_child(ancestor->parent, container, | 391 | container_insert_child(ancestor->pending.parent, container, |
392 | index + (offs < 0 ? 0 : 1)); | 392 | index + (offs < 0 ? 0 : 1)); |
393 | } else { | 393 | } else { |
394 | // Container will move to workspace level, | 394 | // Container will move to workspace level, |
395 | // may be re-split by workspace_layout | 395 | // may be re-split by workspace_layout |
396 | workspace_insert_tiling(ancestor->workspace, container, | 396 | workspace_insert_tiling(ancestor->pending.workspace, container, |
397 | index + (offs < 0 ? 0 : 1)); | 397 | index + (offs < 0 ? 0 : 1)); |
398 | } | 398 | } |
399 | ancestor->height = ancestor->width = 0; | 399 | ancestor->pending.height = ancestor->pending.width = 0; |
400 | ancestor->height_fraction = ancestor->width_fraction = 0; | 400 | ancestor->height_fraction = ancestor->width_fraction = 0; |
401 | if (old_parent) { | 401 | if (old_parent) { |
402 | container_reap_empty(old_parent); | 402 | container_reap_empty(old_parent); |
403 | } | 403 | } |
404 | workspace_squash(container->workspace); | 404 | workspace_squash(container->pending.workspace); |
405 | return true; | 405 | return true; |
406 | } | 406 | } |
407 | } | 407 | } |
@@ -427,14 +427,14 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth, | |||
427 | container = workspace_wrap_children(workspace); | 427 | container = workspace_wrap_children(workspace); |
428 | } | 428 | } |
429 | 429 | ||
430 | if (container->fullscreen_mode == FULLSCREEN_GLOBAL) { | 430 | if (container->pending.fullscreen_mode == FULLSCREEN_GLOBAL) { |
431 | return cmd_results_new(CMD_FAILURE, | 431 | return cmd_results_new(CMD_FAILURE, |
432 | "Can't move fullscreen global container"); | 432 | "Can't move fullscreen global container"); |
433 | } | 433 | } |
434 | 434 | ||
435 | struct sway_seat *seat = config->handler_context.seat; | 435 | struct sway_seat *seat = config->handler_context.seat; |
436 | struct sway_container *old_parent = container->parent; | 436 | struct sway_container *old_parent = container->pending.parent; |
437 | struct sway_workspace *old_ws = container->workspace; | 437 | struct sway_workspace *old_ws = container->pending.workspace; |
438 | struct sway_output *old_output = old_ws ? old_ws->output : NULL; | 438 | struct sway_output *old_output = old_ws ? old_ws->output : NULL; |
439 | struct sway_node *destination = NULL; | 439 | struct sway_node *destination = NULL; |
440 | 440 | ||
@@ -508,7 +508,7 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth, | |||
508 | destination = dst ? &dst->node : &ws->node; | 508 | destination = dst ? &dst->node : &ws->node; |
509 | } else if (strcasecmp(argv[0], "output") == 0) { | 509 | } else if (strcasecmp(argv[0], "output") == 0) { |
510 | struct sway_output *new_output = output_in_direction(argv[1], | 510 | struct sway_output *new_output = output_in_direction(argv[1], |
511 | old_output, container->x, container->y); | 511 | old_output, container->pending.x, container->pending.y); |
512 | if (!new_output) { | 512 | if (!new_output) { |
513 | return cmd_results_new(CMD_FAILURE, | 513 | return cmd_results_new(CMD_FAILURE, |
514 | "Can't find output with name/direction '%s'", argv[1]); | 514 | "Can't find output with name/direction '%s'", argv[1]); |
@@ -706,12 +706,12 @@ static struct cmd_results *cmd_move_in_direction( | |||
706 | "Cannot move workspaces in a direction"); | 706 | "Cannot move workspaces in a direction"); |
707 | } | 707 | } |
708 | if (container_is_floating(container)) { | 708 | if (container_is_floating(container)) { |
709 | if (container->fullscreen_mode) { | 709 | if (container->pending.fullscreen_mode) { |
710 | return cmd_results_new(CMD_FAILURE, | 710 | return cmd_results_new(CMD_FAILURE, |
711 | "Cannot move fullscreen floating container"); | 711 | "Cannot move fullscreen floating container"); |
712 | } | 712 | } |
713 | double lx = container->x; | 713 | double lx = container->pending.x; |
714 | double ly = container->y; | 714 | double ly = container->pending.y; |
715 | switch (direction) { | 715 | switch (direction) { |
716 | case WLR_DIRECTION_LEFT: | 716 | case WLR_DIRECTION_LEFT: |
717 | lx -= move_amt; | 717 | lx -= move_amt; |
@@ -729,8 +729,8 @@ static struct cmd_results *cmd_move_in_direction( | |||
729 | container_floating_move_to(container, lx, ly); | 729 | container_floating_move_to(container, lx, ly); |
730 | return cmd_results_new(CMD_SUCCESS, NULL); | 730 | return cmd_results_new(CMD_SUCCESS, NULL); |
731 | } | 731 | } |
732 | struct sway_workspace *old_ws = container->workspace; | 732 | struct sway_workspace *old_ws = container->pending.workspace; |
733 | struct sway_container *old_parent = container->parent; | 733 | struct sway_container *old_parent = container->pending.parent; |
734 | 734 | ||
735 | if (!container_move_in_direction(container, direction)) { | 735 | if (!container_move_in_direction(container, direction)) { |
736 | // Container didn't move | 736 | // Container didn't move |
@@ -744,7 +744,7 @@ static struct cmd_results *cmd_move_in_direction( | |||
744 | workspace_consider_destroy(old_ws); | 744 | workspace_consider_destroy(old_ws); |
745 | } | 745 | } |
746 | 746 | ||
747 | struct sway_workspace *new_ws = container->workspace; | 747 | struct sway_workspace *new_ws = container->pending.workspace; |
748 | 748 | ||
749 | if (root->fullscreen_global) { | 749 | if (root->fullscreen_global) { |
750 | arrange_root(); | 750 | arrange_root(); |
@@ -781,8 +781,8 @@ static struct cmd_results *cmd_move_to_position_pointer( | |||
781 | } | 781 | } |
782 | struct wlr_cursor *cursor = seat->cursor->cursor; | 782 | struct wlr_cursor *cursor = seat->cursor->cursor; |
783 | /* Determine where to put the window. */ | 783 | /* Determine where to put the window. */ |
784 | double lx = cursor->x - container->width / 2; | 784 | double lx = cursor->x - container->pending.width / 2; |
785 | double ly = cursor->y - container->height / 2; | 785 | double ly = cursor->y - container->pending.height / 2; |
786 | 786 | ||
787 | /* Correct target coordinates to be in bounds (on screen). */ | 787 | /* Correct target coordinates to be in bounds (on screen). */ |
788 | struct wlr_output *output = wlr_output_layout_output_at( | 788 | struct wlr_output *output = wlr_output_layout_output_at( |
@@ -792,11 +792,11 @@ static struct cmd_results *cmd_move_to_position_pointer( | |||
792 | wlr_output_layout_get_box(root->output_layout, output); | 792 | wlr_output_layout_get_box(root->output_layout, output); |
793 | lx = fmax(lx, box->x); | 793 | lx = fmax(lx, box->x); |
794 | ly = fmax(ly, box->y); | 794 | ly = fmax(ly, box->y); |
795 | if (lx + container->width > box->x + box->width) { | 795 | if (lx + container->pending.width > box->x + box->width) { |
796 | lx = box->x + box->width - container->width; | 796 | lx = box->x + box->width - container->pending.width; |
797 | } | 797 | } |
798 | if (ly + container->height > box->y + box->height) { | 798 | if (ly + container->pending.height > box->y + box->height) { |
799 | ly = box->y + box->height - container->height; | 799 | ly = box->y + box->height - container->pending.height; |
800 | } | 800 | } |
801 | } | 801 | } |
802 | 802 | ||
@@ -846,16 +846,16 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
846 | } else if (strcmp(argv[0], "center") == 0) { | 846 | } else if (strcmp(argv[0], "center") == 0) { |
847 | double lx, ly; | 847 | double lx, ly; |
848 | if (absolute) { | 848 | if (absolute) { |
849 | lx = root->x + (root->width - container->width) / 2; | 849 | lx = root->x + (root->width - container->pending.width) / 2; |
850 | ly = root->y + (root->height - container->height) / 2; | 850 | ly = root->y + (root->height - container->pending.height) / 2; |
851 | } else { | 851 | } else { |
852 | struct sway_workspace *ws = container->workspace; | 852 | struct sway_workspace *ws = container->pending.workspace; |
853 | if (!ws) { | 853 | if (!ws) { |
854 | struct sway_seat *seat = config->handler_context.seat; | 854 | struct sway_seat *seat = config->handler_context.seat; |
855 | ws = seat_get_focused_workspace(seat); | 855 | ws = seat_get_focused_workspace(seat); |
856 | } | 856 | } |
857 | lx = ws->x + (ws->width - container->width) / 2; | 857 | lx = ws->x + (ws->width - container->pending.width) / 2; |
858 | ly = ws->y + (ws->height - container->height) / 2; | 858 | ly = ws->y + (ws->height - container->pending.height) / 2; |
859 | } | 859 | } |
860 | container_floating_move_to(container, lx, ly); | 860 | container_floating_move_to(container, lx, ly); |
861 | return cmd_results_new(CMD_SUCCESS, NULL); | 861 | return cmd_results_new(CMD_SUCCESS, NULL); |
@@ -886,7 +886,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
886 | return cmd_results_new(CMD_INVALID, "Invalid y position specified"); | 886 | return cmd_results_new(CMD_INVALID, "Invalid y position specified"); |
887 | } | 887 | } |
888 | 888 | ||
889 | struct sway_workspace *ws = container->workspace; | 889 | struct sway_workspace *ws = container->pending.workspace; |
890 | if (!ws) { | 890 | if (!ws) { |
891 | struct sway_seat *seat = config->handler_context.seat; | 891 | struct sway_seat *seat = config->handler_context.seat; |
892 | ws = seat_get_focused_workspace(seat); | 892 | ws = seat_get_focused_workspace(seat); |
@@ -960,14 +960,14 @@ static struct cmd_results *cmd_move_to_scratchpad(void) { | |||
960 | // If the container is in a floating split container, | 960 | // If the container is in a floating split container, |
961 | // operate on the split container instead of the child. | 961 | // operate on the split container instead of the child. |
962 | if (container_is_floating_or_child(con)) { | 962 | if (container_is_floating_or_child(con)) { |
963 | while (con->parent) { | 963 | while (con->pending.parent) { |
964 | con = con->parent; | 964 | con = con->pending.parent; |
965 | } | 965 | } |
966 | } | 966 | } |
967 | 967 | ||
968 | if (!con->scratchpad) { | 968 | if (!con->scratchpad) { |
969 | root_scratchpad_add_container(con, NULL); | 969 | root_scratchpad_add_container(con, NULL); |
970 | } else if (con->workspace) { | 970 | } else if (con->pending.workspace) { |
971 | root_scratchpad_hide(con); | 971 | root_scratchpad_hide(con); |
972 | } | 972 | } |
973 | return cmd_results_new(CMD_SUCCESS, NULL); | 973 | return cmd_results_new(CMD_SUCCESS, NULL); |