diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2026-04-01 20:37:48 +0200 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2026-04-01 20:37:48 +0200 |
| commit | f2272d4210f80731a200a1a4d41fa1a29e1d2074 (patch) | |
| tree | 63cd8fc5cf54985a905dfbd2bf63d4bd36b4d493 /lib/CWayland | |
| parent | 6390f8d7e7dfe8c0311cffc2e928e93abb92714b (diff) | |
fix demo
Diffstat (limited to 'lib/CWayland')
| -rw-r--r-- | lib/CWayland/CWayland.cc | 15 | ||||
| -rw-r--r-- | lib/CWayland/CWayland.h | 3 |
2 files changed, 9 insertions, 9 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)); diff --git a/lib/CWayland/CWayland.h b/lib/CWayland/CWayland.h index 2db206e..44424a2 100644 --- a/lib/CWayland/CWayland.h +++ b/lib/CWayland/CWayland.h @@ -15,7 +15,8 @@ uint32_t waylean_SIGUSR2(void); // -- Display -lean_obj_res waylean_display_new(b_lean_obj_arg name); +lean_obj_res waylean_display_new (b_lean_obj_arg name); +lean_obj_res waylean_display_flush(b_lean_obj_arg display); // -- Event Loop |
