Replace broad cx.load_all_script_resources() calls with a targeted cx.load_script_resource(handle) to only request the specific resource needed. Refactor script resource loading (platform/src/script/res.rs) by extracting load_script_resource_impl(handle, crate_manifests) and exposing load_script_resource(handle); keep load_all_script_resources() by iterating per-handle. Improve wasm handling: resolve web_url per-resource, set explicit error states when missing, and fire async HTTP requests safely. Remove an early call to load_all_script_resources() from web startup. Additional changes: serve precompressed .br files in the local wasm dev server (with COOP/COEP headers when threaded), add wasm-specific font/theme script entries for widgets, and update various callers (draw shaders, widgets, math_view, gltf/view_splat, image) to use the per-handle loader. These changes reduce unnecessary global loads and limit network/file operations to only required resources.
Introduce a single-threaded wasm build mode and add defensive runtime handling for missing wasm threading support.
- CLI: add --no-threads flag and WasmConfig.threads to control threaded vs single-threaded builds. Parse and strip wasm-specific options before forwarding build/run args.
- Build: select target features and RUSTFLAGS based on threading; omit atomics/bulk-memory features for single-threaded builds. Adjust generated server instructions to require COOP/COEP only for threaded builds.
- Dev server: conditionally include COOP/COEP headers when serving threaded wasm artifacts.
- JS runtime (platform/src/os/web/web.js): guard audio worklet startup and thread creation on wasm._has_thread_support; make alloc_thread_stack return null with clear console warnings when required exports or alignment are missing; pass allocated thread_info to workers.
These changes enable building and running a single-threaded wasm variant without COOP/COEP server requirements and improve runtime resilience when threading features are unavailable.
The Contents.json only had a single universal+platform entry, which is
only recognized by iOS 16+. Add classic per-idiom entries (iphone, ipad,
ios-marketing) so actool compiles both sets into Assets.car. iOS 15
falls back to the idiom-based entries.
Co-authored-by: ant <ant@offline.click>
Android defaults to target/android/, apple to target/apple/.
Prevents cross-platform builds from invalidating each other's caches.
Co-authored-by: ant <ant@offline.click>
Refactor app icon handling into a unified app_icon module that replaces
the old window_icon.rs. Build-time icon generation produces platform-
native formats (ICO with multiple sizes for Windows, ICNS for macOS,
multi-resolution PNGs for Linux/Wayland/X11).
Add `cargo makepad desktop` subcommand for desktop packaging with
automatic icon detection from MAKEPAD_APP_ICON_PATH env var, or from
Cargo package metadata.
Resolve binary names from [[bin]] targets in Cargo.toml so .app bundles,
.exe outputs, and APK labels use the correct name instead of defaulting
to the package name.
Use llvm-rc for Windows .res generation (cross-compilation compatible)
with absolute link paths for reliable resource embedding.
Co-authored-by: ant <ant@offline.click>
* Add macOS video playback support using AVPlayer + CVMetalTextureCache
Extends the Video widget from Android-only to also support macOS with
hardware-accelerated, zero-copy video rendering through Metal. Uses
AVPlayer for decoding and CVMetalTextureCache to map decoded frames
directly to MTLTextures without CPU copies.
Key changes:
- New AppleVideoPlayer module (AVPlayer + CVPixelBuffer → MTLTexture pipeline)
- FFI bindings for CVMetalTextureCache, CMTime, and related Apple APIs
- Video frame polling integrated into macOS paint cycle
- TextureFormat::VideoRGB ungated from Android-only to all platforms
- Video widget made cross-platform (TextureHandleReady wait is Android-only)
- Fixed shader aspect ratio bug (&&→|| for non-positive dimension check)
- Added video demo to uizoo and scratchpad examples
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add iOS video playback support
* Enhance video playback functionality with seek support and current position tracking
Key changes:
- Added `seek_video_playback` operation to allow seeking to specific timestamps.
- Introduced `current_position_ms` field in `VideoTextureUpdatedEvent` for tracking playback position.
- Implemented seeking functionality across iOS, macOS, and Android platforms.
- Updated Video widget to support new controls and indicators for seeking.
* Improve error handling for unsupported texture pixel formats
* Make volume icon drawing use fixed width
* Make play/pause drawing use fixed width
* Remove video from scratchpad
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add **/* glob to Linux NDK unzip to match subdirectories
`*` alone doesn't match `/` on Linux unzip builds with WILD_STOP_AT_DIR,
causing only top-level files to be extracted. Adding `**/*` ensures bin/,
lib64/, sysroot/ subdirectories are included.
* Auto-bundle NDK shared library deps (e.g. libc++_shared.so) into APK
When libmakepad.so has NEEDED entries for shared libraries provided by
the NDK sysroot (like libc++_shared.so from C++ dependencies), those
libraries were not being included in the APK, causing runtime dlopen
failures on device.
Add bundle_ndk_shared_deps() which uses the NDK's llvm-readelf to scan
libmakepad.so for NEEDED entries, then copies any matching .so files
from the NDK sysroot base lib dir into the APK. System libraries
(present in the API-level subdirectory) are excluded since they are
provided by the Android OS at runtime.
The detection is general-purpose and not hardcoded to any specific
library name.
* fix: make SYS_GETTID arch-conditional (186 on x86_64, 178 on aarch64)
The constant was hardcoded to 178 (correct for aarch64 but maps to
query_module on x86_64), causing Android's seccomp filter to kill the
process immediately on x86_64 emulators.
* Upgrade Android NDK from r25 to r28, fix x86_64 seccomp crash
cargo_makepad:
- sdk.rs: NDK version 25.2.9519653 → 28.2.13676358, download URLs r25c → r28b
- sdk.rs: Update NDK_IN extract paths for all platforms (Windows, macOS, Linux)
- sdk.rs: macOS NDK extraction is now host-aware (darwin-aarch64 for Apple Silicon)
- compile.rs: MacosAarch64 uses native darwin-aarch64 prebuilt (no more Rosetta)
- compile.rs: ndk_prebuilt_dir() split for MacosX64 vs MacosAarch64
platform:
- libc_sys.rs: Make SYS_GETTID arch-conditional (186 on x86_64, 178 on aarch64)
Was hardcoded to 178 which maps to query_module on x86_64, causing
Android seccomp to kill the process on x86_64 emulators
- android.rs: Add pub display field on CxOs, pub make_current() on CxAndroidDisplay
for Servo embedding support
* Fix GLSL struct constructor crash on Android GLES drivers
The r28 script-based shader backend (shader_glsl.rs) generates GLSL
struct constructor syntax in the vertex/fragment main() unpack code,
e.g.: vb_geom = QuadVertex(vec2(packed_geometry_0.x, ...));
Some GLES drivers (notably Android emulator ANGLE/SwiftShader) reject
this with 'Structure constructor arguments do not match structure
fields', even though it's valid per the GLES 3.0 spec.
This is a regression from r28. The old r25 shader compiler
(generate_glsl.rs) used VarUnpacker::unpack_var which generated direct
swizzle assignments (vb_geom.xy = packed_geometry_0.xy), never struct
constructors in the unpack path. The r25 branch is not affected.
Fix: generate per-sub-field assignments for struct-typed variables in
the main() geometry/instance/varying unpack code, matching the r25
behavior. Struct constructors in user shader function bodies are
unaffected.
* fix(android): Proper fullscreen support on API 30+ and FullscreenWindow/NormalizeWindow ops
Android platform changes:
- Add CxOsOp::FullscreenWindow handler: sets os.fullscreen flag and calls JNI setFullScreen
- Add CxOsOp::NormalizeWindow handler: clears os.fullscreen and exits fullscreen
MakepadActivity.java:
- onCreate: On API 30+, switch from legacy Theme.NoTitleBar.Fullscreen to
Theme_DeviceDefault_NoActionBar to avoid FLAG_FULLSCREEN conflict
- onCreate: Call setDecorFitsSystemWindows(false) and set
LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS before setContentView so SurfaceView
is laid out at y=0 from the start
- Refactor setFullScreen into applyFullScreen with proper WindowInsetsController
API on API 30+ (hide/show statusBars + navigationBars)
- Legacy path (pre-API 30) uses full immersive sticky flags
- ResizingLayout.onApplyWindowInsets: Return WindowInsets.CONSUMED to prevent
system bar insets from offsetting child SurfaceView
* Fix Android touch radius DPI scaling and revert aggressive fullscreen inset handling
- Divide touch.radius by dpi_factor alongside touch.abs for correct touch sizing
- Return insets instead of consuming them in ResizingLayout so child views get proper insets
- Remove premature setDecorFitsSystemWindows/cutout mode override; let apps opt in via FullscreenWindow
* Make DrawImage image_scale/image_pan fields pub
Needed by external crates (e.g. servo makepad_shell) that create custom
widgets using DrawImage and need to flip the Y axis for GL render textures.
---------
Co-authored-by: ant <ant@offline.click>
This ensures that if an error occurs in a `cargo makepad` invocation,
the `cargo makepad` binary will actually return an error
(and importantly, an error exit code) instead of returning a success
exit code of `0` in all cases.
This allows CI passes and automated testing to work as normal.
Extra: cleaned up "show help" output
* WIP
* Improvements for cursor control
* Enhance text selection and key event handling for Samsung keyboard compatibility
* Default to multine inputtype in android
* WIP Input configurations
* Enhance iOS text input handling
* Cleanup
* Comment out 'Next' variant across platforms for future implementation.
* Rename IME Config API to match web APIs
* Fix Android emoji deletion by implementing UTF-16 code unit index conversion
* Proper ASCII-only input and improve iOS keyboard handling
* Replace 'is_numeric_only' with 'input_mode'
* Prevent pasting invalid characters
* Cleanup
* Cleanup
* Hide clipboard actions on text change
* Cleanup
* Unify keyboard event types and fix iOS text input regressions
Unified TextInputEvent with new fields for better IME support across platforms:
- Added `composition` field for IME preview ranges (CJKinput)
- Added `full_state_sync` for complete buffer state (Android approach)
- Added `replace_range` for autocorrect/suggestion replacements (iOS approach)
All platforms: Standardized on CharOffset for character position handling
* Prevent text synchronization with the platform during active composition
* Add UITextInputCurrentInputModeDidChangeNotification support
* Add underline for active IME composition in TextInput
* Improve editor action handling for multiline inputs on Android
* Enhance IME composition tracking and clipboard action handling in TextInput
* Simplify IME state handling on Android
* Cleanup IME handling on iOS
* Cleanup
* Cleanup IME handling on iOS
* Improve docs/comments
* Improve docs/comments
* Add floating cursor support for keyboard trackpad in iOS
* Refine IME handling in TextInput to prevent iOS buffer loss during composition updates
* Move UITextInput protocol implementation into its own module
* Move MakepadInputConnection into its own file
* Cleanup
* Improve general IME handling in TextInput. Improve docs and comments
* Refactor text input configuration to separate soft keyboard settings for mobile platforms.
* Fix `Uncaught ReferenceError: env is not defined`
at bindgen.js: const imports = __wbg_get_imports(); imports.env = env;
at (index): let wasm = await init({module_or_path: module}, env);
* fix `Uncaught DOMException: WebAssembly.Memory object could not be cloned.`
at web.js: worker.postMessage(this.alloc_thread_stack(args.context_ptr, args.timer));
* add missing rustc flags to enable threading
* allow cargo makepad in linux arm
* debugs
* don't color cargo tree
* remove debug prints
* remove unsupported os handling that didn't exist before
Cx API:
- Implement existing ShowClipboardActions
- Add HideClipboardActions
- Cross-platform API ready for iOS implementation
Android Implementation:
- Native ActionMode integration with floating toolbar (API 23+)
- JNI bindings for showing/hiding menu and handling clipboard actions
- Event system for Copy/Cut/Paste/Select All actions
- Smart menu state management based on selection and clipboard
TextInput Integration:
- Long press selects word and shows menu
- Double tap and long press selects word and shows menu
- Selection preservation when tapping selected text
* Ensure that LongPress (LongClick) on Android properly uses touch slop
Previously, we assumed that multiple touch action events would occur
before a LongClick, but that is not necessarily true.
It is possible to just have one down touch immediately followed by a
LongClick, so we now account for that.
This also fixes the tracking of touch event locations such that
stale values aren't accidentally used when calculating if a finger movement
exceeded the allowable touch slop for considering a touch as a long press.
(Rust would've caught that... thanks Java)
* remove excess log stmt
* Add permission handling for audio input
- Introduced `CheckPermission` and `RequestPermission` operations in `CxOsOp` for managing audio input permissions.
- Implemented permission status checks and requests across iOS, macOS, and Android.
- Added a new `Permission` module to define permission types and statuses.
- Updated event handling to include permission results in the event system.
- Updated manifest files to include necessary permissions for audio input on Android.
* Add audio example project
- Added a new example project for audio processing and permission handling
- Implemented UI components for audio device selection, microphone capture, and playback controls.
- Integrated permission handling for audio input and updated the workspace configuration to include the new example.
* Implement audio permission in Web, catch up Linux and Windows
* Refactor iOS permission handling to avoid ios_app re-entrancy
* Implement iOS mic capture and add sample rate to AudioInfo
* Ensure iOS audio output uses loudspeaker, only when not using external devices
* Enhance audio example by handling sample rates and resampling
* Allow users of `TextInput` to know when a keypress had no effect
This PR makes the `TextInput` widget emit a `TextInputAction::KeyDownUnhandled`
action upon keypresses that don't actually make any change to the widget's selection.
This action is currently only emitted for the Up, Down, Left, and Right arrow keys,
but we can certainly add it to others like Backspace, Delete, etc if desired.
Use case: if you want to enable custom behavior when the user uses arrow keys
to navigate an empty TextInput widget, such as jumping up out of the TextInput focus
to edit the most recent message you just sent in a chat app, then this PR
is necessary. Otherwise there's no way to know whether a given input actually had
any effect on the TextInput's inner cursor/selection state.
* Add the FaceID usage description to iOS Info.plist
Allows Makepad apps to use biometric auth on iOS