summaryrefslogtreecommitdiffstats
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 23:34:14 -0400
committerLibravatar GitHub <noreply@github.com>2018-03-29 23:34:14 -0400
commit472e81f35d689d67cda241acafda91c688d61046 (patch)
treeb8b52173a9791e3b13a0316ab9d316a80a6adc20 /sway/commands/focus.c
parentMerge pull request #1647 from acrisci/refactor-tree (diff)
parentRevert "Refactor tree" (diff)
downloadsway-472e81f35d689d67cda241acafda91c688d61046.tar.gz
sway-472e81f35d689d67cda241acafda91c688d61046.tar.zst
sway-472e81f35d689d67cda241acafda91c688d61046.zip
Merge pull request #1653 from swaywm/revert-1647-refactor-tree
Revert "Refactor tree"
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r--sway/commands/focus.c9
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
9static bool parse_movement_direction(const char *name, 9static 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
34struct cmd_results *cmd_focus(int argc, char **argv) { 33struct 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 }