diff options
author | 2018-08-26 10:49:49 -0400 | |
---|---|---|
committer | 2018-08-26 10:49:49 -0400 | |
commit | df7083a2d0842a3985747770774075a8f5ecdaef (patch) | |
tree | 2aad57ba7f7eec9fdb51b98859f6da826a4d39a1 /common | |
parent | Merge pull request #2488 from RyanDwyer/separate-gaps-functions (diff) | |
parent | Remove layout.c (diff) | |
download | sway-df7083a2d0842a3985747770774075a8f5ecdaef.tar.gz sway-df7083a2d0842a3985747770774075a8f5ecdaef.tar.zst sway-df7083a2d0842a3985747770774075a8f5ecdaef.zip |
Merge pull request #2515 from RyanDwyer/remove-layout-file
Remove layout.c
Diffstat (limited to 'common')
-rw-r--r-- | common/util.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c index 467aa4b5..561b3804 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -175,3 +175,24 @@ failed: | |||
175 | free(current); | 175 | free(current); |
176 | return NULL; | 176 | return NULL; |
177 | } | 177 | } |
178 | |||
179 | bool sway_dir_to_wlr(enum movement_direction dir, enum wlr_direction *out) { | ||
180 | switch (dir) { | ||
181 | case MOVE_UP: | ||
182 | *out = WLR_DIRECTION_UP; | ||
183 | break; | ||
184 | case MOVE_DOWN: | ||
185 | *out = WLR_DIRECTION_DOWN; | ||
186 | break; | ||
187 | case MOVE_LEFT: | ||
188 | *out = WLR_DIRECTION_LEFT; | ||
189 | break; | ||
190 | case MOVE_RIGHT: | ||
191 | *out = WLR_DIRECTION_RIGHT; | ||
192 | break; | ||
193 | default: | ||
194 | return false; | ||
195 | } | ||
196 | |||
197 | return true; | ||
198 | } | ||