Repository navigation
dasImgui, dasGlfw: native input-method composition; GLFW 3.5.1 - #4368
Conversation
4020340 to
334da63
Compare
|
CI note: both The first |
ubuntu-latest moved to 26.04. The playground lockfile held Playwright 1.60.0, which has no browser builds for that host, so `npx playwright install --with-deps chromium` stopped with "Playwright does not support chromium on ubuntu26.04-x64" before any test ran. The lock moves to 1.64.1; the other Playwright suites already lock 1.62.1, the first release with ubuntu26.04 builds.
The page-level keydown guard that stops Space, the arrows and Home/End from scrolling the embedding page also cancelled them in the input bridge's composition textarea, so Space never typed in a browser text field. The guard now skips input, textarea and contenteditable targets, in the default shell, the site's frame injection and the dasLLAMA demo shells. The browser test presses a real Space. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apple clang enables blocks, so clang-c/Index.h declared block types the committed binding does not have; the module and bind_clangbind parse with -fno-blocks. macOS linked a never-set LIBCLANG_LIB and now links the imported libclang target like the other platforms. The binder strips the header root in its symlink-resolved form too, and a typedef whose canonical type spells long keeps its declared spelling (size_t), so a binding regenerated on macOS matches Windows and Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
334da63 to
87bcf0a
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It spans native cross-platform IME C++, a patched-GLFW build-system change, and a full binding regeneration, with behavior the author notes is unverified on Windows, so it warrants final human review.
No open issues 🎉
1 file not reviewed
site/tests/playground/package-lock.json: Generated file
What changed in this PR
This PR adds native (desktop) input-method (IME/composition) support to dasImgui and upgrades dasGlfw from GLFW 3.4 to a patched GLFW 3.5.1. Previously CJK input methods were broken on desktop (hidden/misplaced composition, conversion-Enter submitting the field, X11 key loss) and Space was swallowed in browser text fields. The change wires the published editor caret into a new C++ IME backend that draws the preedit at the caret, positions the candidate window, and commits composition on click/field-change — mirroring the existing browser bridge.
Changes:
- New
modules/dasImgui/src/native_input.hIME state machine plusmodule_imgui_app.cpp/dasIMGUI.main.cppbindings (preedit injection, overlay/caret/font readback, per-field font tracking) and GLFW init wrappers for OpenGL/Vulkan/Other. - dasGlfw now builds GLFW 3.5.1 with an IME patch (
patches/glfw-3.5.1-ime.patch, applied viagit applyunderGIT_CEILING_DIRECTORIES), regenerates the binding (newfunc_6.cpp, host-neutralsize_t/resolved-prefix handling in clangbind), and web-stubs the new entry points. - Browser shells (5 copies) stop cancelling keys aimed at text fields;
widget_bboxis promoted to a publicimgui_playwrighthelper (local copies removed from ~20 record tests) and dasClangBind builds on macOS (-fno-blocks).
| File | Description |
|---|---|
| modules/dasImgui/src/native_input.h | New desktop IME backend: preedit state, caret rectangle, overlay drawing, click-commit, key-settle focus |
| modules/dasImgui/src/module_imgui_app.cpp | Binds the IME API + init wrappers; AOT prototypes added; attaches/detaches native IME |
| modules/dasImgui/src/dasIMGUI.main.cpp | Records the active field's font via TextInputFontNote/GetTextInputFont |
| modules/dasImgui/src/imgui_backend_state.h | Declares GetTextInputFont |
| modules/dasImgui/widgets/imgui_playwright.das | New public widget_bbox; record tests drop their local copies |
| modules/dasImgui/utils/imgui2rst.das | New "Widget rectangle" doc group for widget_bbox |
| modules/dasImgui/tests/test_text_input_example.das, text_input_browser.cjs | New composition/commit/cancel/clamp coverage; browser Space-types test |
| modules/dasImgui/examples/features/text_input/{main.das,todo.md} | ime_state/ime_preedit live command; status/matrix updates |
| modules/dasImgui/{ARCHITECTURE.md,CMakeLists.txt} | Native-composition section; 3.5 libname/comments |
| modules/dasGlfw/** (CMakeLists, patch, binding .inc/.cpp, headers, stubs, .das_package, ARCHITECTURE.md) | GLFW 3.5.1 patched build, regenerated binding, web stubs, 3.5 soname |
| modules/dasClangBind/** (CMakeLists, cbind_boost.das, bind_clangbind.das) | macOS -fno-blocks build; host-neutral binder output |
| web/templates/wasm_canvas_shell.html, site/files/examples.js, examples/dasLLAMA/*/web_shell.html | Keep default for keys aimed at text fields |
| skills/internal/clang_bind_build.md | macOS libclang + regen/turn-off guidance |
| examples/games/sequence/ci_smoke_test.sh | Bundle native lib bumped to 3.5 |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
It combines a desktop GLFW major upgrade, regenerated bindings, and a new native IME subsystem whose macOS/X11/Windows runtime behavior is largely unverifiable here (Windows unverified by the author), warranting human review.
1 open issue
1 file not reviewed
site/tests/playground/package-lock.json: Generated file
Review effort: Balanced
87bcf0a to
babba4e
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It is a large, cross-platform change spanning native C++ IME integration, a GLFW version bump with regenerated bindings and CMake patch logic, whose desktop/X11/macOS behavior is verified only by manual sessions that cannot be reproduced in automated review.
1 open issue
1 resolved since last review
1 file not reviewed
site/tests/playground/package-lock.json: Generated file
Review effort: Balanced
GLFW 3.4 keeps macOS composition text to itself, puts the candidate window at the view corner and reports keys the input method consumed. The desktop build now downloads 3.5.1 and applies the open glfw pull requests 2130 (preedit callback, candidate rectangle, text-input focus) and 1972, narrowed to filtered key presses, with the duplicate-press timestamp guard removed. The binding is regenerated: the input-method entry points are bound, stubbed on the web; the library is libglfw.3.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The desktop backend draws the preedit at the caret in the field's font, publishes the candidate rectangle, holds GLFW text-input focus only while a field owns text input, released after keys settle, and follows the field's viewport window. A click mid-composition commits it into the field it leaves, as the browser bridge does. The text_input example reports the IME state; its test injects a composition and checks overlay, caret and commit. imgui_playwright gains widget_bbox, replacing 25 per-script copies in the record drivers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
babba4e to
8294941
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a large cross-platform native IME subsystem plus a vendored-patch GLFW upgrade whose Windows and real-OS input-method paths are unverified by the author's own ledger, so it needs human sign-off despite no concrete defects being found.
No open issues 🎉
1 resolved since last review
1 file not reviewed
site/tests/playground/package-lock.json: Generated file
Review effort: Balanced

Behavior change: the desktop GLFW library is now
libglfw.3.5(3.5.1 plus an input-method patch) - bundles naminglibglfw.3.4must update.Why. CJK input methods did not work in dasImgui on desktop: macOS hid the composition and misplaced the candidate window, the conversion Enter submitted the field, and X11 lost keys under IBus. In the browser, Space never typed.
What changes.
Observable behavior.
Where to look.
modules/dasImgui/src/native_input.h, the X11 hunks ofmodules/dasGlfw/patches/glfw-3.5.1-ime.patch,modules/dasImgui/ARCHITECTURE.md#native-composition.Validation, claims, ledger
Validation
@playwright/test^1.64.1), cherry-picked unchanged:ubuntu-latestis 26.04 and Playwright 1.50 has no chromium for it, so the playground e2e lane was red on every PR touchingsite/.modules/dasImgui/tests/test_text_input_example.das5/5 on macOS and Linux, headless and windowed;modules/dasGlfw/tests16/16; browser suite (modules/dasImgui/tests/run_browser_tests.cjs, Chrome + WebKit) 11/11 on web libraries built from this tree.check_clangbind_freshpasses on macOS (Homebrew LLVM 22.1.5), andbind_glfw.dasreproduces the committed GLFW binding.preflight --fullon macOS: the fast tier was red on line length only; after the wraps, lint, format and the docs gates were re-run targeted, and the lanes it had skipped ran once each: tests-cpp, tests-interp, tests-jit, tests-aot (fulltest_aot) and imgui all green.docs/sphinx-htmlfails to importsphinx_sitemapfrom Homebrew's Sphinx before reading any page; the docs generator gates (das2rst, imgui2rst, uncategorized, untracked) pass.Claims - stated, not tested
size_talias spelling and resolved-prefix strip: verified by regenerating on macOS and comparing; CI runs the self-binder check only on mingw.Not done
daspkgshell must be self-contained, and the site's copy is a deliberate second guard for cards deployed before this change.Architecture citations
modules/dasImgui/ARCHITECTURE.md#browser-composition-ordering(last line changed):SetTextInputCaret(also records the font),browser_input.h,imgui_text_source_edit.das(two citers) - all still match.#native-composition:native_input.h,module_imgui_app.cpp(inject),dasIMGUI.main.cpp(TextInputFontNote) - match.modules/dasGlfw/ARCHITECTURE.md#ime-patch:native_input.h,modules/dasGlfw/CMakeLists.txt- match.