diff options
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r-- | sway/tree/output.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c index 7fbeeebd..50a2c535 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -1,4 +1,5 @@ #define _POSIX_C_SOURCE 200809L +#include <assert.h> #include <ctype.h> #include <string.h> #include <strings.h> @@ -12,6 +13,21 @@ #include "log.h" #include "util.h" +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; +} + static void restore_workspaces(struct sway_output *output) { // Workspace output priority for (int i = 0; i < root->outputs->length; i++) { |