summaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-08-06 08:24:14 -0400
committerDrew DeVault <[email protected]>2015-08-06 08:24:14 -0400
commit82bc36c6812b24fca27c2ec176e2c2998e4df6d5 (patch)
treee43f61300ecb8f868bf9e40e43bdbd60bf02ecfb /sway/layout.c
parent47b28bd335fe279df35f746d5797a1071cb4b989 (diff)
Start to build out window management functions
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c
new file mode 100644
index 00000000..aeb8167e
--- /dev/null
+++ b/sway/layout.c
@@ -0,0 +1,10 @@
+#include <stdlib.h>
+#include <stdbool.h>
+#include <wlc/wlc.h>
+#include "layout.h"
+
+wlc_handle get_topmost(wlc_handle output, size_t offset) {
+ size_t memb;
+ const wlc_handle *views = wlc_output_get_views(output, &memb);
+ return (memb > 0 ? views[(memb - 1 + offset) % memb] : 0);
+}