diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-29 23:29:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-29 23:29:29 -0400 |
commit | d0c7f66e950689b70196a890b62b82ff3c66e103 (patch) | |
tree | b8b52173a9791e3b13a0316ab9d316a80a6adc20 /sway/commands/focus.c | |
parent | Merge pull request #1647 from acrisci/refactor-tree (diff) | |
download | sway-d0c7f66e950689b70196a890b62b82ff3c66e103.tar.gz sway-d0c7f66e950689b70196a890b62b82ff3c66e103.tar.zst sway-d0c7f66e950689b70196a890b62b82ff3c66e103.zip |
Revert "Refactor tree"
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r-- | sway/commands/focus.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 64f079f4..f1a8078f 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -3,11 +3,10 @@ | |||
3 | #include "log.h" | 3 | #include "log.h" |
4 | #include "sway/input/input-manager.h" | 4 | #include "sway/input/input-manager.h" |
5 | #include "sway/input/seat.h" | 5 | #include "sway/input/seat.h" |
6 | #include "sway/tree/view.h" | 6 | #include "sway/view.h" |
7 | #include "sway/commands.h" | 7 | #include "sway/commands.h" |
8 | 8 | ||
9 | static bool parse_movement_direction(const char *name, | 9 | static bool parse_movement_direction(const char *name, enum movement_direction *out) { |
10 | enum movement_direction *out) { | ||
11 | if (strcasecmp(name, "left") == 0) { | 10 | if (strcasecmp(name, "left") == 0) { |
12 | *out = MOVE_LEFT; | 11 | *out = MOVE_LEFT; |
13 | } else if (strcasecmp(name, "right") == 0) { | 12 | } else if (strcasecmp(name, "right") == 0) { |
@@ -32,7 +31,7 @@ static bool parse_movement_direction(const char *name, | |||
32 | } | 31 | } |
33 | 32 | ||
34 | struct cmd_results *cmd_focus(int argc, char **argv) { | 33 | struct cmd_results *cmd_focus(int argc, char **argv) { |
35 | struct sway_container *con = config->handler_context.current_container; | 34 | swayc_t *con = config->handler_context.current_container; |
36 | struct sway_seat *seat = config->handler_context.seat; | 35 | struct sway_seat *seat = config->handler_context.seat; |
37 | if (con->type < C_WORKSPACE) { | 36 | if (con->type < C_WORKSPACE) { |
38 | return cmd_results_new(CMD_FAILURE, "focus", | 37 | return cmd_results_new(CMD_FAILURE, "focus", |
@@ -51,7 +50,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { | |||
51 | "Expected 'focus <direction|parent|child|mode_toggle>' or 'focus output <direction|name>'"); | 50 | "Expected 'focus <direction|parent|child|mode_toggle>' or 'focus output <direction|name>'"); |
52 | } | 51 | } |
53 | 52 | ||
54 | struct sway_container *next_focus = container_get_in_direction(con, seat, direction); | 53 | swayc_t *next_focus = get_swayc_in_direction(con, seat, direction); |
55 | if (next_focus) { | 54 | if (next_focus) { |
56 | sway_seat_set_focus(seat, next_focus); | 55 | sway_seat_set_focus(seat, next_focus); |
57 | } | 56 | } |