summaryrefslogtreecommitdiff
path: root/lib/CWayland/CWayland.cc
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2026-04-01 20:37:48 +0200
committerHannes Schulze <haschu0103@outlook.de>2026-04-01 20:37:48 +0200
commitf2272d4210f80731a200a1a4d41fa1a29e1d2074 (patch)
tree63cd8fc5cf54985a905dfbd2bf63d4bd36b4d493 /lib/CWayland/CWayland.cc
parent6390f8d7e7dfe8c0311cffc2e928e93abb92714b (diff)
fix demo
Diffstat (limited to 'lib/CWayland/CWayland.cc')
-rw-r--r--lib/CWayland/CWayland.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/CWayland/CWayland.cc b/lib/CWayland/CWayland.cc
index abb9ee5..3e6bd0e 100644
--- a/lib/CWayland/CWayland.cc
+++ b/lib/CWayland/CWayland.cc
@@ -179,11 +179,11 @@ lean_obj_res waylean_display_new(b_lean_obj_arg name)
return lean_io_result_mk_ok(waylean_disp);
}
-// Display.roundtrip : (display : @& Display) → IO Unit
-lean_obj_res waylean_display_roundtrip(b_lean_obj_arg display)
+// Display.flush : (display : @& Display) → IO Unit
+lean_obj_res waylean_display_flush(b_lean_obj_arg disp_obj)
{
- wl_display* disp = static_cast<wl_display*>(lean_get_external_data(display));
- if (wl_display_roundtrip(disp) == -1) { return io_result_mk_from_errno("<unknown>"); }
+ wl_display* disp = static_cast<wl_display*>(lean_get_external_data(disp_obj));
+ if (wl_display_flush(disp) == -1) { return io_result_mk_from_errno("<unknown>"); }
return lean_io_result_mk_ok(lean_box(0));
}
@@ -1169,11 +1169,10 @@ lean_obj_res waylean_argument_buffer_read_fd(b_lean_obj_arg buffer_obj)
namespace
{
- int dispatcher_func(const void* user_data, void* target, uint32_t opcode, const wl_message* msg, wl_argument* args)
+ int dispatcher_func(const void* dispatcher_data, void* target, uint32_t opcode, const wl_message* msg, wl_argument* args)
{
- if (!user_data) { return 0; }
-
- auto handler = ref{ (lean_object*)user_data };
+ auto user_data = wl_proxy_get_user_data(static_cast<wl_proxy*>(target));
+ auto handler = ref{ static_cast<lean_object*>(user_data) };
auto buffer = new argument_buffer;
auto buffer_obj = ref::steal(lean_alloc_external(waylean_argument_buffer_class(), buffer));