mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Use parse_movement_direction
This commit is contained in:
parent
08736255a3
commit
32806d16ee
1 changed files with 2 additions and 9 deletions
|
@ -57,15 +57,8 @@ static struct cmd_results *focus_output(struct sway_container *con,
|
||||||
|
|
||||||
if (!output) {
|
if (!output) {
|
||||||
enum movement_direction direction;
|
enum movement_direction direction;
|
||||||
if (strcmp(identifier, "left") == 0) {
|
if (!parse_movement_direction(identifier, &direction) ||
|
||||||
direction = MOVE_LEFT;
|
direction == MOVE_PARENT || direction == MOVE_CHILD) {
|
||||||
} else if (strcmp(identifier, "right") == 0) {
|
|
||||||
direction = MOVE_RIGHT;
|
|
||||||
} else if (strcmp(identifier, "up") == 0) {
|
|
||||||
direction = MOVE_UP;
|
|
||||||
} else if (strcmp(identifier, "down") == 0) {
|
|
||||||
direction = MOVE_DOWN;
|
|
||||||
} else {
|
|
||||||
free(identifier);
|
free(identifier);
|
||||||
return cmd_results_new(CMD_INVALID, "focus",
|
return cmd_results_new(CMD_INVALID, "focus",
|
||||||
"There is no output with that name");
|
"There is no output with that name");
|
||||||
|
|
Loading…
Reference in a new issue