lvgl host: fix platform_set_embed_parent signature - #31
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A developer configuring with
-DNEUI_WITH_LVGL=ONhitplatform_set_embed_parentas an undefined symbol at link time. The seam wasn't missing — it was declared with the wrong parameter type.hosts/crossplatform/platform.h:62declares:platform_lvgl.cppdefined the third parameter asunsigned long. That's a different overload, and on MSVC x64unsigned longis 32-bit so it can't even collapse into the pointer type by accident. Thevoid*version thatwidgets.cpp:1987actually calls was never defined. Every other platform layer (win32,macos,linux,ios,null) already usedvoid*.Changes
wd->embed_parentthe way the null host does, so the publicNEUI_API_EMBEDstate round-trips. LVGL owns the whole display, so nothing acts on it: there is no foreign native parent,event_fdstays -1,pump_and_tickstays a no-op.docs/host-lvgl.md— "might not be needed in LVGL, but the host must still provide it" was itself a doc gap.Interface audit
Diffed every
platform_*seam declared inplatform.hagainst the definitions in all six platform layers (return type + parameter types). This was the only real mismatch.platform_retained_tree_changed/platform_retained_widget_invalidateare LVGL-only seams (guarded byNEUI_PLATFORM_LVGLin the header) and correctly defined only there.Verification
Not built:
platform_lvgl.cppcompiles only on Windows with-DNEUI_WITH_LVGL=ON, and this was authored on macOS. The change is confined to that one file, andget_widget/embed_parentare both already used throughout it — a Windows LVGL build should confirm the link error is gone.