summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/commands/focus.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index e48e48aa..83b8c64a 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -95,9 +95,6 @@ static struct sway_node *get_node_in_output_direction(
95 95
96static struct sway_node *node_get_in_direction(struct sway_container *container, 96static struct sway_node *node_get_in_direction(struct sway_container *container,
97 struct sway_seat *seat, enum movement_direction dir) { 97 struct sway_seat *seat, enum movement_direction dir) {
98 if (dir == MOVE_CHILD) {
99 return seat_get_active_child(seat, &container->node);
100 }
101 if (container->is_fullscreen) { 98 if (container->is_fullscreen) {
102 if (dir == MOVE_PARENT) { 99 if (dir == MOVE_PARENT) {
103 return NULL; 100 return NULL;
@@ -256,8 +253,20 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
256 "or 'focus output <direction|name>'"); 253 "or 'focus output <direction|name>'");
257 } 254 }
258 255
256 if (direction == MOVE_CHILD) {
257 struct sway_node *focus = seat_get_active_child(seat, node);
258 if (focus) {
259 seat_set_focus(seat, focus);
260 }
261 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
262 }
263
259 if (node->type == N_WORKSPACE) { 264 if (node->type == N_WORKSPACE) {
260 // A workspace is focused, so just jump to the next output 265 if (direction == MOVE_PARENT) {
266 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
267 }
268
269 // Jump to the next output
261 struct sway_output *new_output = 270 struct sway_output *new_output =
262 output_get_in_direction(workspace->output, direction); 271 output_get_in_direction(workspace->output, direction);
263 if (!new_output) { 272 if (!new_output) {