mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
Wrap to fartherest output when running focus output
Also moves the `opposite_direction` function into `util.c` as it's used in two places now.
This commit is contained in:
parent
f841d2ed74
commit
bf19f63a79
4 changed files with 29 additions and 13 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#define _XOPEN_SOURCE 700
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -138,3 +139,18 @@ bool parse_boolean(const char *boolean, bool current) {
|
|||
// All other values are false to match i3
|
||||
return false;
|
||||
}
|
||||
|
||||
enum wlr_direction opposite_direction(enum wlr_direction d) {
|
||||
switch (d) {
|
||||
case WLR_DIRECTION_UP:
|
||||
return WLR_DIRECTION_DOWN;
|
||||
case WLR_DIRECTION_DOWN:
|
||||
return WLR_DIRECTION_UP;
|
||||
case WLR_DIRECTION_RIGHT:
|
||||
return WLR_DIRECTION_LEFT;
|
||||
case WLR_DIRECTION_LEFT:
|
||||
return WLR_DIRECTION_RIGHT;
|
||||
}
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue