aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c16
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 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <assert.h>
2#include <ctype.h> 3#include <ctype.h>
3#include <string.h> 4#include <string.h>
4#include <strings.h> 5#include <strings.h>
@@ -12,6 +13,21 @@
12#include "log.h" 13#include "log.h"
13#include "util.h" 14#include "util.h"
14 15
16enum wlr_direction opposite_direction(enum wlr_direction d) {
17 switch (d) {
18 case WLR_DIRECTION_UP:
19 return WLR_DIRECTION_DOWN;
20 case WLR_DIRECTION_DOWN:
21 return WLR_DIRECTION_UP;
22 case WLR_DIRECTION_RIGHT:
23 return WLR_DIRECTION_LEFT;
24 case WLR_DIRECTION_LEFT:
25 return WLR_DIRECTION_RIGHT;
26 }
27 assert(false);
28 return 0;
29}
30
15static void restore_workspaces(struct sway_output *output) { 31static void restore_workspaces(struct sway_output *output) {
16 // Workspace output priority 32 // Workspace output priority
17 for (int i = 0; i < root->outputs->length; i++) { 33 for (int i = 0; i < root->outputs->length; i++) {