summaryrefslogtreecommitdiff
path: root/lib/Wayland
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2026-04-01 20:51:11 +0200
committerHannes Schulze <haschu0103@outlook.de>2026-04-01 20:51:11 +0200
commit54d62ad2f3eb72d57683780b55dad2a97b1e2dcb (patch)
treefdd7ae4c7615d406208391f5b3e6b42089a3a141 /lib/Wayland
parentf2272d4210f80731a200a1a4d41fa1a29e1d2074 (diff)
clean up demo
Diffstat (limited to 'lib/Wayland')
-rw-r--r--lib/Wayland/Display.lean4
-rw-r--r--lib/Wayland/Native.lean3
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/Wayland/Display.lean b/lib/Wayland/Display.lean
index f07c5ff..0a049b3 100644
--- a/lib/Wayland/Display.lean
+++ b/lib/Wayland/Display.lean
@@ -317,6 +317,10 @@ def Object.listen {ι : InterfaceName} [iface : Interface ι] (obj : Object ι)
ReaderT.run (handler event) global
global.listen obj.proxy actualHandler
+/-- Shorthand to ensure the reference count of an `Object` does not drop to `0`. -/
+def Object.keep {ι : InterfaceName} (obj : Object ι) : DisplayM σ Unit :=
+ obj.proxy.keep
+
end Proxies
end Wayland
diff --git a/lib/Wayland/Native.lean b/lib/Wayland/Native.lean
index dd138e4..f8d4c53 100644
--- a/lib/Wayland/Native.lean
+++ b/lib/Wayland/Native.lean
@@ -136,4 +136,7 @@ opaque Proxy.sendConstructor : (proxy : @& Proxy) → (opcode : UInt32) → (arg
@[extern "waylean_proxy_listen"]
opaque Proxy.listen : (proxy : @& Proxy) → (handler : UInt32 → ArgumentBuffer → EventLoop M × M) → IO Unit
+@[extern "waylean_proxy_keep"]
+opaque Proxy.keep : (proxy : @& Proxy) → IO Unit
+
end Wayland.Native