Commit graph

530 commits

Author SHA1 Message Date
offline-ant
744f45db3e platform: native mobile selection handles (#930)
* platform: popup window API with X11/Wayland support

- Add popup window type for context menus and dropdowns
- Wayland: xdg_popup with grab for compositor-driven dismiss
- X11: override-redirect windows with pointer grab
- Explicit-close semantics: app must handle PopupDismissed
- Fix Wayland crash on repeated context menu open/close
- Emit WindowClosed before PopupDismissed in PopupDone

* platform: native mobile selection handles

iOS: custom UIView selection handles with UIPanGestureRecognizer (all versions),
UITextSelectionDisplayInteraction for native highlights (iOS 16+),
MakepadSelectionRect for UITextInput protocol.

Android: custom SelectionHandleView with GradientDrawable oval, touch drag
listeners, JNI bridge for handle drag events.

Widgets: TextFlow clipboard action integration (show on touch up with selection,
hide on touch down/focus lost, TextCut handler), PortalList select-all and
clipboard actions, selection bounding rect computation for popup positioning.

Includes text_selection example app.

---------

Co-authored-by: ant <ant@offline.click>
2026-03-08 12:15:31 +01:00
Lutz
619f364d20 fix: Single-slot UInt/SInt instance attributes render incorrectly (#922)
Co-authored-by: Lutz Paelike <lutz.paelike@ehealthafrica.org>
2026-03-08 11:26:52 +01:00
offline-ant
dd83d4b759 platform: small fixes and quality improvements (#928)
- Android log levels: map log! macro levels to Android log priorities
  (ERROR=6, WARN=5, INFO=4). Some devices suppress DEBUG by default.
- cargo-makepad android: show help text instead of panicking on missing
  or invalid subcommand.
- Android build: discover .class files dynamically instead of hardcoding
  ~25 individual paths. Add Java 8 source/target flags.
- Remove deprecated AsyncTask import from MakepadNetwork.java.
- Studio stdout: add newline after JSON messages for JSON-lines parsing.
- Studio stdout: skip profiler timing in stdout mode to avoid overhead.
- Script thread: fix panic on empty call stack in call_has_me/call_has_try.
- Cursor: reset to Default on FingerHoverOut in TextFlow and TextInput.

Co-authored-by: ant <ant@offline.click>
2026-03-08 11:24:18 +01:00
offline-ant
bdb9911614 platform: cycle tap count after triple-click so fast double-clicks keep working (#931)
process_tap_count incremented without bound. TextInput handles
tap_count 2 (select word) and 3 (select all) but ignored counts
>= 4. Rapid repeated double-clicks produced tap counts of 4, 5, 6...
hitting the _ => {} fallthrough and doing nothing.

Cycle the counter back to 1 after reaching 3 (1->2->3->1->2->3).

Co-authored-by: ant <ant@offline.click>
2026-03-08 11:22:12 +01:00
Admin
af3995b33b remove apprs 2026-03-08 10:28:40 +01:00
Admin
c8412703b0 oops. uids 2026-03-08 08:42:49 +01:00
Jason Yau
5f3e13d3bc Add IME Support for Linux (X11) (#926)
* regenerate windows-rs to export ImmAssociateContext

* fix ime popup window still shown when TextInput has no focus

* fix ime popup window still shown when TextInput has no focus for macos

* fix ime himc state

* IME support for linux

---------

Co-authored-by: jasonqiu <jasonqiuchen@outlook.com>
2026-03-07 15:50:05 +01:00
Admin
1cb8ce2347 fix 2026-03-07 11:54:59 +01:00
Admin
8c5987039d fix shader compiler 2026-03-06 18:49:24 +01:00
Admin
2aad6a6aa9 drumroll 2026-03-06 17:21:17 +01:00
Admin
ed062cb224 fix shader compiler state clobber 2026-03-06 17:21:17 +01:00
Admin
bb331d0eb3 split f32 + uniformbuffers 2026-03-06 17:21:17 +01:00
Jason Yau
77709bb766 Fix: IME Popup Window Appears Without TextInput Focus (#924)
* regenerate windows-rs to export ImmAssociateContext

* fix ime popup window still shown when TextInput has no focus

* fix ime popup window still shown when TextInput has no focus for macos

---------

Co-authored-by: jasonqiu <jasonqiuchen@outlook.com>
2026-03-06 16:50:01 +01:00
Sabin Regmi
3905ae4d1c Load script resources per-handle (avoid global loads) (#923)
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.
2026-03-06 16:01:07 +01:00
offline-ant
abb71be0e0 selection: clipboard delegate, primary selection, mobile handles (#912)
* selection: clipboard delegate, primary selection, mobile UI, handles, accessibility

Level 0: Route clipboard through Makepad instead of arboard. Custom
ClipboardDelegate in havishell forwards set_text/get_text/clear through
Makepad's CopyToClipboard and pending paste state. Fix Wayland serial
constraint by queuing CopyToClipboard when no serial is available.

Level 1: Primary selection (Linux). Add CxOsOp::SetPrimarySelection,
Wayland zwp_primary_selection_device_manager_v1 protocol bindings, X11
PRIMARY atom handling. HAVI stores selection text in SharedDocumentSelection
and calls set_primary_selection on change.

Level 2: Mobile clipboard actions UI. Long-press selects word and shows
native clipboard toolbar. TextCopy/TextCut events return selection text.

Level 3: Selection handle API. Add CxOsOp Show/Update/HideSelectionHandles,
Event::SelectionHandleDrag, and HAVI integration for handle drag events.
Platform stubs for all backends.

Level 4: Accessibility plumbing. Add CxOsOp::AccessibilityUpdate with
type-erased Box<dyn Any + Send> payload. HAVI implements
notify_accessibility_tree_update to forward accesskit::TreeUpdate through
Makepad. Platform no-op stubs.

* wayland: handle primary selection data_offer child objects

---------

Co-authored-by: ant <ant@offline.click>
2026-03-06 12:17:25 +01:00
Sabin Regmi
78f8c52c90 Remove debug title update in redraw handler (#919)
Remove a leftover debug call that set the document title when handling ToWasmRedrawAll in platform/src/os/web/web.rs. This avoids an unnecessary DOM update used only for debugging and cleans up the redraw handler.
2026-03-06 12:16:24 +01:00
Sabin Regmi
a2d4cf68fe Consider Logo or Control primary on wasm32 (#921)
Add a wasm32-specific branch in KeyModifiers::is_primary so the primary modifier is treated as true when either `logo` or `control` is set on WebAssembly targets. This preserves expected web behavior where Meta/Command or Control can act as the primary key. Also tighten the non-Apple cfg to exclude wasm32 explicitly to avoid overlapping cfg matches.
2026-03-06 12:16:08 +01:00
Lutz
16c3bc1c33 fix: iOS app crashes on device rotation (#920) 2026-03-06 12:15:52 +01:00
Sabin Regmi
98f0c4cb2a Add --no-threads option and runtime thread checks (#918)
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.
2026-03-05 20:53:20 +01:00
Admin
6ecc045812 widget tree refactor 2026-03-04 09:52:17 +01:00
Admin
4e3ce9d0a8 terminal window resizing stable 2026-03-04 00:25:32 +01:00
Admin
3f71a13648 widget tree change 2026-03-03 21:22:58 +01:00
Admin
3af7afb04c widget tree fixup 2026-03-03 20:19:06 +01:00
Admin
4ca7685256 terminal wrangling 2026-03-03 13:21:53 +01:00
Admin
521b31d132 y flip webgl rendertartet 2026-03-03 09:42:54 +01:00
Admin
106de2274f rename network 2026-03-03 09:18:19 +01:00
Admin
307dfe4709 remove origin from widget tree 2026-03-03 08:55:01 +01:00
offline-ant
e1bcba34a3 texture: add set_data_u32 for resize-safe updates (#910)
Add Texture::set_data_u32(cx, width, height, data) that replaces pixel
data and dimensions in one call. Unlike put_back_vec_u32, this also
updates width/height, making it safe for image sources that change
resolution (animated images, lazy-loaded placeholders).

Co-authored-by: ant <ant@offline.click>
2026-03-03 08:52:54 +01:00
Admin
e6aed38950 finall fix render glitch 2026-03-02 20:16:29 +01:00
Admin
d64373e940 add studio proto 2026-03-02 12:30:33 +01:00
Admin
d4683f522f remote control 2026-03-02 12:07:59 +01:00
Admin
45ebb95cd4 remote working 2026-03-02 10:40:33 +01:00
Admin
6c5f2728a9 cleanup 2026-03-01 23:15:39 +01:00
Admin
daf440ee80 wasm 2026-03-01 20:22:11 +01:00
Admin
d5d59d01c3 backend proto splitoff 2026-03-01 10:12:00 +01:00
Admin
a6a859f28d fix better errors 2026-02-28 23:19:25 +01:00
Admin
58a9032ee2 studio2 2026-02-28 22:30:21 +01:00
Admin
d0d781bd10 studio2 otw 2026-02-28 21:27:26 +01:00
Admin
52b4bac5bd add cx module 2026-02-28 12:35:13 +01:00
Admin
5b07941f35 plaintext error 2026-02-28 11:40:11 +01:00
offline-ant
b7231c05fc ios: use CVPixelBuffer-first GL/Metal bridge path (#904)
Co-authored-by: ant <ant@offline.click>
2026-02-28 11:17:48 +01:00
offline-ant
2781d6fc24 trigger redraw on Screenshot request in windowed mode (#905)
dispatch_studio_msg pushed to screenshot_requests but never
triggered a redraw. The GL readback that captures the screenshot
only runs during the render path, so the request was never
serviced in windowed backends (Wayland, X11, macOS).

Co-authored-by: ant <ant@offline.click>
2026-02-28 11:17:35 +01:00
offline-ant
b0880778b4 platform: add custom studio app message events (#906)
Co-authored-by: ant <ant@offline.click>
2026-02-28 11:17:10 +01:00
Julián Montes de Oca
5a56fe5338 Video Widget: Support on More Platforms (#867)
* Add support for Video widget on WASM

* Add support for Video widget on Linux

* Linux video:  GStreamer appsink pipeline, GL texture upload, accurate seeking

* Add support for Video widget on Windows

* Harden cross-platform video playback and error handling

* Cleanup video playback logs

* Restore wasm builds

* Restore linux builds

* Restore linux builds

* Remove unused import
2026-02-27 18:52:49 +01:00
Admin
7f9b0451bd centralised resource cache 2026-02-27 16:55:05 +01:00
offline-ant
d361d6d2dc iOS: app icons, fullscreen, iOS 15 support, GL texture fix, NSLog logging (#897)
Co-authored-by: ant <ant@offline.click>
2026-02-27 16:42:47 +01:00
offline-ant
9740c47689 Font optimization: reduce atlas 64MB→4MB, use static data for builtins (#898)
Co-authored-by: ant <ant@offline.click>
2026-02-27 16:39:38 +01:00
offline-ant
54bae43891 deduplicate script resources by file path (#899)
file_resource and crate_resource now check if a resource with the same
abs_path already exists before creating a new entry. Returns the existing
handle instead of reading the same file multiple times.

Before: 54 resource entries, same font files loaded up to 15 times each
(427MB of duplicate heap data). After: ~10 unique entries, each file
loaded once (~50MB).

Co-authored-by: ant <ant@offline.click>
2026-02-27 16:38:00 +01:00
offline-ant
1dca9d750b iOS: GL render bridge (EAGL+IOSurface) and ios build command (#894)
* iOS: add GL render bridge (EAGL+IOSurface), fix linking, fix warnings

- Add EaglRenderBridge for iOS (GLES 3.0 context sharing textures with
  Metal via IOSurface), mirroring macOS CglRenderBridge
- Add iOS GlRenderBridge inner field and Cx methods
  (create_gl_render_bridge, create_gl_render_bridge_texture, restore_gl_context)
- Widen IOSurface support from macos-only to macos/ios/tvos in apple_sys
  and metal.rs (CxOsTexture fields, update_shared_texture, etc.)
- Expose metal_device() accessor on IosApp
- Replace removed SSLSetEnableCertVerify with SSLSetSessionOption
  (kSSLSessionOptionBreakOnServerAuth) to fix iOS linker error
- Remove unused apple_util::* imports in ios.rs and ios_app.rs
- Fix iOS deployment target from 26.0 to 17.0 in cargo_makepad

* cargo-makepad: add apple ios build command, expose IosBuildResult fields

---------

Co-authored-by: ant <ant@offline.click>
2026-02-27 08:40:41 +01:00
Admin
bc3455937e implicit io markers 2026-02-27 08:36:46 +01:00