diff options
author | M Stoeckl <[email protected]> | 2019-01-21 12:39:16 -0500 |
---|---|---|
committer | M Stoeckl <[email protected]> | 2019-01-21 12:39:16 -0500 |
commit | d7ff776552bef524e905d85c2a5e7651c8408658 (patch) | |
tree | ae20feac64f93f776e9c9e136c62459705e97987 /sway/tree/output.c | |
parent | 410c961388bbfecb5f1b63e4a1977a78709a6e57 (diff) |
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.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++) { |