mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
focus: do nothing on focus prev|next for workspaces
This commit is contained in:
parent
7efb5d4673
commit
1f469e1692
@ -16,7 +16,11 @@
|
|||||||
|
|
||||||
static bool get_direction_from_next_prev(struct sway_container *container,
|
static bool get_direction_from_next_prev(struct sway_container *container,
|
||||||
struct sway_seat *seat, const char *name, enum wlr_direction *out) {
|
struct sway_seat *seat, const char *name, enum wlr_direction *out) {
|
||||||
enum sway_container_layout parent_layout = container_parent_layout(container);
|
enum sway_container_layout parent_layout = L_NONE;
|
||||||
|
if (container) {
|
||||||
|
parent_layout = container_parent_layout(container);
|
||||||
|
}
|
||||||
|
|
||||||
if (strcasecmp(name, "prev") == 0) {
|
if (strcasecmp(name, "prev") == 0) {
|
||||||
switch (parent_layout) {
|
switch (parent_layout) {
|
||||||
case L_HORIZ:
|
case L_HORIZ:
|
||||||
@ -27,6 +31,8 @@ static bool get_direction_from_next_prev(struct sway_container *container,
|
|||||||
case L_STACKED:
|
case L_STACKED:
|
||||||
*out = WLR_DIRECTION_UP;
|
*out = WLR_DIRECTION_UP;
|
||||||
break;
|
break;
|
||||||
|
case L_NONE:
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -40,6 +46,8 @@ static bool get_direction_from_next_prev(struct sway_container *container,
|
|||||||
case L_STACKED:
|
case L_STACKED:
|
||||||
*out = WLR_DIRECTION_DOWN;
|
*out = WLR_DIRECTION_DOWN;
|
||||||
break;
|
break;
|
||||||
|
case L_NONE:
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -399,6 +407,10 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!direction) {
|
||||||
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (node->type == N_WORKSPACE) {
|
if (node->type == N_WORKSPACE) {
|
||||||
// Jump to the next output
|
// Jump to the next output
|
||||||
struct sway_output *new_output =
|
struct sway_output *new_output =
|
||||||
|
Loading…
Reference in New Issue
Block a user