diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2019-11-03 19:18:05 -0700 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-11-04 23:48:39 +0100 |
commit | 1f469e1692ea05720afb32ebf038afa19bd27154 (patch) | |
tree | a6e902064aaeb43aa542d991b4a886d541653e65 /sway | |
parent | Rename symbol set_cloexec to sway_set_cloexec, remove duplicates. (diff) | |
download | sway-1f469e1692ea05720afb32ebf038afa19bd27154.tar.gz sway-1f469e1692ea05720afb32ebf038afa19bd27154.tar.zst sway-1f469e1692ea05720afb32ebf038afa19bd27154.zip |
focus: do nothing on focus prev|next for workspaces
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/focus.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 844d1293..d745aab5 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c | |||
@@ -16,7 +16,11 @@ | |||
16 | 16 | ||
17 | static bool get_direction_from_next_prev(struct sway_container *container, | 17 | static bool get_direction_from_next_prev(struct sway_container *container, |
18 | struct sway_seat *seat, const char *name, enum wlr_direction *out) { | 18 | struct sway_seat *seat, const char *name, enum wlr_direction *out) { |
19 | enum sway_container_layout parent_layout = container_parent_layout(container); | 19 | enum sway_container_layout parent_layout = L_NONE; |
20 | if (container) { | ||
21 | parent_layout = container_parent_layout(container); | ||
22 | } | ||
23 | |||
20 | if (strcasecmp(name, "prev") == 0) { | 24 | if (strcasecmp(name, "prev") == 0) { |
21 | switch (parent_layout) { | 25 | switch (parent_layout) { |
22 | case L_HORIZ: | 26 | case L_HORIZ: |
@@ -27,6 +31,8 @@ static bool get_direction_from_next_prev(struct sway_container *container, | |||
27 | case L_STACKED: | 31 | case L_STACKED: |
28 | *out = WLR_DIRECTION_UP; | 32 | *out = WLR_DIRECTION_UP; |
29 | break; | 33 | break; |
34 | case L_NONE: | ||
35 | return true; | ||
30 | default: | 36 | default: |
31 | return false; | 37 | return false; |
32 | } | 38 | } |
@@ -40,6 +46,8 @@ static bool get_direction_from_next_prev(struct sway_container *container, | |||
40 | case L_STACKED: | 46 | case L_STACKED: |
41 | *out = WLR_DIRECTION_DOWN; | 47 | *out = WLR_DIRECTION_DOWN; |
42 | break; | 48 | break; |
49 | case L_NONE: | ||
50 | return true; | ||
43 | default: | 51 | default: |
44 | return false; | 52 | return false; |
45 | } | 53 | } |
@@ -399,6 +407,10 @@ struct cmd_results *cmd_focus(int argc, char **argv) { | |||
399 | } | 407 | } |
400 | } | 408 | } |
401 | 409 | ||
410 | if (!direction) { | ||
411 | return cmd_results_new(CMD_SUCCESS, NULL); | ||
412 | } | ||
413 | |||
402 | if (node->type == N_WORKSPACE) { | 414 | if (node->type == N_WORKSPACE) { |
403 | // Jump to the next output | 415 | // Jump to the next output |
404 | struct sway_output *new_output = | 416 | struct sway_output *new_output = |