CRITICAL FIX: Restore NewFrame/Shutdown/GetDisplayMetrics lost in rebase
- File was truncated at line 605 during rebase onto upstream/master
- Restored all three functions with proper implementations
REVIEW FEEDBACK ADDRESSED:
1. Rotation: Re-query display metrics in NewFrame when window resizes
2. Keyboard opt-in: SetJniEnabled(false by default) - app retains control
- SetKeyboardType() / SetKeyboardAction() for customization
3. Keyboard timing: GetWantTextInput() / ResubmitTextInput() for app control
4. Back button: Hides soft keyboard when visible (consumes event)
5. Unicode input: Kept as optional JNI plumbing (app decides when to poll)
6. GetAssetData: Documented in PR_9469_REVIEW_RESPONSE.md (restore in main.cpp)
7. TERM_WINDOW: Documented (EGL surface lifecycle fix in main.cpp)
8. NavBar/insets: GetNavBarHeight() + GetBottomInset() (DisplayCutout API 28+)
Long press: SetLongPressCallback() + SetLongPressDuration()
Pressure: Full pressure sensitivity system
PRESSURE SENSITIVITY:
- Per-pointer pressure tracking (up to 10 pointers)
- GetTouchPressure(pointer_id) API
- SetPressureEnabled() / SetPressureThreshold()
- Long-press requires sustained min pressure (not just timer)
- Pressure-weighted scrolling (firmer press = faster scroll)
- Move events update pressure and cancel long-press if pressure drops
All APIs are opt-in. Default behavior preserves pre-PR #9469 app control.
Backend improvements (imgui_impl_android.h/.cpp):
- Moved JNI soft-keyboard and Unicode char polling from the example into
the backend. The application no longer needs any JNI boilerplate.
- Added clipboard support via JNI to Android ClipboardManager. (#7259)
- Added display metrics (DPI, density, refresh rate, orientation) via JNI.
Used by the example to set main_scale from actual device density instead
of hardcoded 2.0f.
- BREAKING CHANGE: ImGui_ImplAndroid_Init() now takes additional
asset_manager and native_activity parameters. See before/after in header.
Example (main.cpp):
- Removed ShowSoftKeyboardInput() and PollUnicodeChars() JNI helpers (~120 lines).
- Removed their forward declarations and per-frame calls.
- Updated Init() call to new signature.
- Use ImGui_ImplAndroid_GetDisplayMetrics() for main_scale.
- All other comments, EGL block, GetAssetData, APP_CMD cases unchanged.
MainActivity.kt: unchanged (same 3 JNI bridge methods, now called by backend).
docs/CHANGELOG.txt: Added entries for backend and example changes.
Previously WGVK was hard-disabled from WGSL via #if !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGVK),
forcing the SPIRV fallback unconditionally. Now the WGSL path is attempted on all backends
and an empty stage_desc is returned when the module fails to compile letting the existing
SPIRV fallback at the call site kick in.
Revert part of ac261203a58e7cb3db8c7dbbb9665ed92ffac1b7, 9ee3d731b5934b92da9ebe8ae2442015eac600ac (#8866, #8163, #7998, #7988) since we have a better solution.
Since we ship GLFW 3.2 binaries for Windows this makes our examples a little better behaving by default.
Ideally we'd use ImGui_ImplWin32_GetDpiScaleForHwnd() and ImGui_ImplWin32_GetDpiScaleForMonitor() but they are too much code to copy.
This also removes the dispatch onto main when adding the finished buffers back into the cache. This operation should be fine to run on any thread as long as it's inside the sync block.