aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 23:41:33 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-29 23:41:33 -0400
commitdc8c9fbeb664518c76066cc28ee29452c6c30128 (patch)
tree88c2de0d08e00b2a30cb20cdfadfa6e53f5c59b4 /sway/commands/focus.c
parentMerge pull request #1653 from swaywm/revert-1647-refactor-tree (diff)
downloadsway-dc8c9fbeb664518c76066cc28ee29452c6c30128.tar.gz
sway-dc8c9fbeb664518c76066cc28ee29452c6c30128.tar.zst
sway-dc8c9fbeb664518c76066cc28ee29452c6c30128.zip
Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r--sway/commands/focus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index f1a8078f..64f079f4 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -3,10 +3,11 @@
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/view.h" 6#include "sway/tree/view.h"
7#include "sway/commands.h" 7#include "sway/commands.h"
8 8
9static bool parse_movement_direction(const char *name, enum movement_direction *out) { 9static bool parse_movement_direction(const char *name,
10 enum movement_direction *out) {
10 if (strcasecmp(name, "left") == 0) { 11 if (strcasecmp(name, "left") == 0) {
11 *out = MOVE_LEFT; 12 *out = MOVE_LEFT;
12 } else if (strcasecmp(name, "right") == 0) { 13 } else if (strcasecmp(name, "right") == 0) {
@@ -31,7 +32,7 @@ static bool parse_movement_direction(const char *name, enum movement_direction *
31} 32}
32 33
33struct cmd_results *cmd_focus(int argc, char **argv) { 34struct cmd_results *cmd_focus(int argc, char **argv) {
34 swayc_t *con = config->handler_context.current_container; 35 struct sway_container *con = config->handler_context.current_container;
35 struct sway_seat *seat = config->handler_context.seat; 36 struct sway_seat *seat = config->handler_context.seat;
36 if (con->type < C_WORKSPACE) { 37 if (con->type < C_WORKSPACE) {
37 return cmd_results_new(CMD_FAILURE, "focus", 38 return cmd_results_new(CMD_FAILURE, "focus",
@@ -50,7 +51,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
50 "Expected 'focus <direction|parent|child|mode_toggle>' or 'focus output <direction|name>'"); 51 "Expected 'focus <direction|parent|child|mode_toggle>' or 'focus output <direction|name>'");
51 } 52 }
52 53
53 swayc_t *next_focus = get_swayc_in_direction(con, seat, direction); 54 struct sway_container *next_focus = container_get_in_direction(con, seat, direction);
54 if (next_focus) { 55 if (next_focus) {
55 sway_seat_set_focus(seat, next_focus); 56 sway_seat_set_focus(seat, next_focus);
56 } 57 }