diff options
author | 2018-11-01 01:01:17 +0100 | |
---|---|---|
committer | 2018-11-01 01:01:17 +0100 | |
commit | 35fda6765b154c1824b3e347579b9d41b309212c (patch) | |
tree | 3f81a96d7aa72cc4cd8e94c3f656ce27c6b6b34f /common/util.c | |
parent | Merge pull request #3042 from madblobfish/swaymsg-fish-completions (diff) | |
parent | Wrap to fartherest output when running focus output (diff) | |
download | sway-35fda6765b154c1824b3e347579b9d41b309212c.tar.gz sway-35fda6765b154c1824b3e347579b9d41b309212c.tar.zst sway-35fda6765b154c1824b3e347579b9d41b309212c.zip |
Merge pull request #3037 from RyanDwyer/focus-output-wrap
Wrap to fartherest output when running focus output
Diffstat (limited to 'common/util.c')
-rw-r--r-- | common/util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c index 78d46a2a..f4588b57 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _XOPEN_SOURCE 700 | 1 | #define _XOPEN_SOURCE 700 |
2 | #include <assert.h> | ||
2 | #include <sys/types.h> | 3 | #include <sys/types.h> |
3 | #include <sys/stat.h> | 4 | #include <sys/stat.h> |
4 | #include <unistd.h> | 5 | #include <unistd.h> |
@@ -138,3 +139,18 @@ bool parse_boolean(const char *boolean, bool current) { | |||
138 | // All other values are false to match i3 | 139 | // All other values are false to match i3 |
139 | return false; | 140 | return false; |
140 | } | 141 | } |
142 | |||
143 | enum wlr_direction opposite_direction(enum wlr_direction d) { | ||
144 | switch (d) { | ||
145 | case WLR_DIRECTION_UP: | ||
146 | return WLR_DIRECTION_DOWN; | ||
147 | case WLR_DIRECTION_DOWN: | ||
148 | return WLR_DIRECTION_UP; | ||
149 | case WLR_DIRECTION_RIGHT: | ||
150 | return WLR_DIRECTION_LEFT; | ||
151 | case WLR_DIRECTION_LEFT: | ||
152 | return WLR_DIRECTION_RIGHT; | ||
153 | } | ||
154 | assert(false); | ||
155 | return 0; | ||
156 | } | ||