aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
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);
+}