aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-21 12:39:16 -0500
committerLibravatar M Stoeckl <code@mstoeckl.com>2019-01-21 12:39:16 -0500
commitd7ff776552bef524e905d85c2a5e7651c8408658 (patch)
treeae20feac64f93f776e9c9e136c62459705e97987 /sway/tree/output.c
parentswaybar: fix setting floating watcher slots (diff)
downloadsway-d7ff776552bef524e905d85c2a5e7651c8408658.tar.gz
sway-d7ff776552bef524e905d85c2a5e7651c8408658.tar.zst
sway-d7ff776552bef524e905d85c2a5e7651c8408658.zip
Move sway-specific functions in common/util.c into sway/
Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
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++) {