aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/workspace.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 23:29:29 -0400
committerLibravatar GitHub <noreply@github.com>2018-03-29 23:29:29 -0400
commitd0c7f66e950689b70196a890b62b82ff3c66e103 (patch)
treeb8b52173a9791e3b13a0316ab9d316a80a6adc20 /sway/commands/workspace.c
parentMerge pull request #1647 from acrisci/refactor-tree (diff)
downloadsway-d0c7f66e950689b70196a890b62b82ff3c66e103.tar.gz
sway-d0c7f66e950689b70196a890b62b82ff3c66e103.tar.zst
sway-d0c7f66e950689b70196a890b62b82ff3c66e103.zip
Revert "Refactor tree"
Diffstat (limited to 'sway/commands/workspace.c')
-rw-r--r--sway/commands/workspace.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index 8f39e5fc..fa891398 100644
--- a/sway/commands/workspace.c
+++ b/sway/commands/workspace.c
@@ -4,7 +4,7 @@
4#include "sway/commands.h" 4#include "sway/commands.h"
5#include "sway/config.h" 5#include "sway/config.h"
6#include "sway/input/seat.h" 6#include "sway/input/seat.h"
7#include "sway/tree/workspace.h" 7#include "sway/workspace.h"
8#include "list.h" 8#include "list.h"
9#include "log.h" 9#include "log.h"
10#include "stringop.h" 10#include "stringop.h"
@@ -17,15 +17,15 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
17 17
18 int output_location = -1; 18 int output_location = -1;
19 19
20 struct sway_container *current_container = config->handler_context.current_container; 20 swayc_t *current_container = config->handler_context.current_container;
21 struct sway_container *old_workspace = NULL, *old_output = NULL; 21 swayc_t *old_workspace = NULL, *old_output = NULL;
22 if (current_container) { 22 if (current_container) {
23 if (current_container->type == C_WORKSPACE) { 23 if (current_container->type == C_WORKSPACE) {
24 old_workspace = current_container; 24 old_workspace = current_container;
25 } else { 25 } else {
26 old_workspace = container_parent(current_container, C_WORKSPACE); 26 old_workspace = swayc_parent_by_type(current_container, C_WORKSPACE);
27 } 27 }
28 old_output = container_parent(current_container, C_OUTPUT); 28 old_output = swayc_parent_by_type(current_container, C_OUTPUT);
29 } 29 }
30 30
31 for (int i = 0; i < argc; ++i) { 31 for (int i = 0; i < argc; ++i) {
@@ -57,7 +57,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
57 if (config->reading || !config->active) { 57 if (config->reading || !config->active) {
58 return cmd_results_new(CMD_DEFER, "workspace", NULL); 58 return cmd_results_new(CMD_DEFER, "workspace", NULL);
59 } 59 }
60 struct sway_container *ws = NULL; 60 swayc_t *ws = NULL;
61 if (strcasecmp(argv[0], "number") == 0) { 61 if (strcasecmp(argv[0], "number") == 0) {
62 if (!(ws = workspace_by_number(argv[1]))) { 62 if (!(ws = workspace_by_number(argv[1]))) {
63 char *name = join_args(argv + 1, argc - 1); 63 char *name = join_args(argv + 1, argc - 1);
@@ -92,7 +92,7 @@ struct cmd_results *cmd_workspace(int argc, char **argv) {
92 workspace_switch(ws); 92 workspace_switch(ws);
93 current_container = 93 current_container =
94 sway_seat_get_focus(config->handler_context.seat); 94 sway_seat_get_focus(config->handler_context.seat);
95 struct sway_container *new_output = container_parent(current_container, C_OUTPUT); 95 swayc_t *new_output = swayc_parent_by_type(current_container, C_OUTPUT);
96 96
97 if (config->mouse_warping && old_output != new_output) { 97 if (config->mouse_warping && old_output != new_output) {
98 // TODO: Warp mouse 98 // TODO: Warp mouse