diff options
-rw-r--r-- | sway/commands/focus.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 894025ad..9cd8bfae 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -57,15 +57,8 @@ static struct cmd_results *focus_output(struct sway_container *con, | |||
57 | 57 | ||
58 | if (!output) { | 58 | if (!output) { |
59 | enum movement_direction direction; | 59 | enum movement_direction direction; |
60 | if (strcmp(identifier, "left") == 0) { | 60 | if (!parse_movement_direction(identifier, &direction) || |
61 | direction = MOVE_LEFT; | 61 | direction == MOVE_PARENT || direction == MOVE_CHILD) { |
62 | } else if (strcmp(identifier, "right") == 0) { | ||
63 | direction = MOVE_RIGHT; | ||
64 | } else if (strcmp(identifier, "up") == 0) { | ||
65 | direction = MOVE_UP; | ||
66 | } else if (strcmp(identifier, "down") == 0) { | ||
67 | direction = MOVE_DOWN; | ||
68 | } else { | ||
69 | free(identifier); | 62 | free(identifier); |
70 | return cmd_results_new(CMD_INVALID, "focus", | 63 | return cmd_results_new(CMD_INVALID, "focus", |
71 | "There is no output with that name"); | 64 | "There is no output with that name"); |