summaryrefslogtreecommitdiff
path: root/sway/layout.c
blob: aeb8167eaabe74e5f80038a58bfcbaade4e5b633 (plain)
1
2
3
4
5
6
7
8
9
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);
}