From 95c10ce3c780e16cc488c8c1eeaec815d475fd77 Mon Sep 17 00:00:00 2001 From: defiantnerd <97224712+defiantnerd@users.noreply.github.com> Date: Fri, 28 Aug 2026 11:03:00 +0200 Subject: [PATCH] lvgl host: fix platform_set_embed_parent signature platform.h declares the embed seam as void platform_set_embed_parent(Session*, uint32_t, void* native_parent); but platform_lvgl.cpp defined the third parameter as `unsigned long`. That is a different overload - and on MSVC x64 `unsigned long` is 32-bit, so it cannot even collapse into the pointer type by accident. The `void*` version that widgets.cpp actually calls was therefore never defined, and any -DNEUI_WITH_LVGL=ON build failed to link with an undefined symbol. Match the header, and record the value into wd->embed_parent the way the null host does so the public NEUI_API_EMBED state round-trips. LVGL owns the whole display, so nothing ever acts on it: there is no foreign native parent to embed into, event_fd stays -1 and pump_and_tick stays a no-op. Documented as such in the host's stubbed-or-absent list. Audited every other platform_* seam in platform.h against all six platform layers (return type + parameter types); this was the only mismatch. --- docs/host-lvgl.md | 3 +++ hosts/crossplatform/platform_lvgl.cpp | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/host-lvgl.md b/docs/host-lvgl.md index 82ac44f..01a3f2a 100644 --- a/docs/host-lvgl.md +++ b/docs/host-lvgl.md @@ -57,6 +57,9 @@ scope): own display driver, which an embedded target does anyway. - Dialogs are resizable; overlay changes (combo drop, popup menu, toast) still invalidate the whole frame. +- DAW embedding (`NEUI_API_EMBED`): the seams are present so the host links and the API round-trips, + but LVGL owns the whole display - there is no foreign native parent, so `set_parent` is recorded + and ignored, `event_fd` is -1, and `pump_and_tick` is a no-op. **Known cost to be aware of on 565 targets**: LVGL's software vector path renders ThorVG only into ARGB8888/XRGB8888, so on RGB565 every vector task round-trips through a temporary full-framebuffer diff --git a/hosts/crossplatform/platform_lvgl.cpp b/hosts/crossplatform/platform_lvgl.cpp index ee42de2..1def87a 100644 --- a/hosts/crossplatform/platform_lvgl.cpp +++ b/hosts/crossplatform/platform_lvgl.cpp @@ -1437,9 +1437,19 @@ namespace xpl_host g_retired_windows.push_back(w); } - void platform_set_embed_parent(Session*, uint32_t, unsigned long) {} - int platform_embed_event_fd(void*) { return -1; } - void platform_embed_pump_and_tick(void*) {} + // DAW-embedding seams - LVGL owns the whole display, so there is no foreign + // native parent to embed into. The setter still records the value (as the + // null host does) so the public NEUI_API_EMBED state round-trips; nothing + // ever acts on it, and platform_create_plugwindow ignores wd.embed_parent. + void platform_set_embed_parent(Session* session, uint32_t widget_index, + void* native_parent) + { + if (!session) return; + auto* wd = session->get_widget(widget_index); + if (wd) wd->embed_parent = reinterpret_cast(native_parent); + } + int platform_embed_event_fd(void* /*native_handle*/) { return -1; } + void platform_embed_pump_and_tick(void* /*native_handle*/) {} void platform_destroy_window(WidgetData& wd) {