summaryrefslogtreecommitdiff
path: root/src/layouts.nim
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2020-08-10 01:41:31 -0700
committerkitty piapiac <kcp@bsd.computer>2020-08-10 01:41:31 -0700
commit1ff1a0f51255958e83ee7c3f17fd0be8c628fc51 (patch)
tree7036f3685c67ba45cfc34dff5449569a8bd80047 /src/layouts.nim
parent90c3fb297e2992cd311e85a236d3fef754296591 (diff)
some stuff
Diffstat (limited to 'src/layouts.nim')
-rw-r--r--src/layouts.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/layouts.nim b/src/layouts.nim
new file mode 100644
index 0000000..3de5da4
--- /dev/null
+++ b/src/layouts.nim
@@ -0,0 +1,17 @@
+import objects, x11/xlib
+
+proc masterStack* (wm: WindowManager, w: cuint, h: cuint, offset: cuint) =
+ var
+ n = cuint wm.clients.len
+ leftoverPixels = h - ((n-1) * (h div (n-1)))
+ lastEnd: cint = 0
+
+ for i in 1..n-1:
+ var height = (h div (n-1))
+ if leftoverPixels > 0:
+ height += 1
+ leftoverPixels -= 1
+
+ discard wm.display.XMoveResizeWindow(wm.clients[i], cint w div 2, lastEnd, (w div 2)-offset, height-offset)
+
+ lastEnd += cint height \ No newline at end of file