Commit graph

560 commits

Author SHA1 Message Date
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
offline-ant
b62592c6ad gl_render_bridge: fix Android EGL wiring and reset GL state on restore (#889)
Fix EGL context initialization on Android to properly wire up the GL
render bridge display/context/surface.

Add GL state reset in restore_gl_context on Linux/Android to prevent
state leakage from external GL consumers (e.g. Servo) back into the
Makepad render pipeline.

Co-authored-by: ant <ant@offline.click>
2026-02-26 11:35:54 +01:00
offline-ant
5edb28bd5e cargo-makepad: cross-platform icon build pipeline and desktop packaging (#890)
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>
2026-02-26 11:33:26 +01:00
offline-ant
4116b17a9c FOOTGUN FIX: panic on nil return from script_mod! in from_script_mod (#891)
When script_mod! is used with 'let app = startup() do ...' but the
block omits the final 'app' expression, the module returns nil. This
silently creates an App with an empty WidgetRef -- no window, no UI,
no error. The app runs indefinitely doing nothing.

Panic with an actionable message instead of silently succeeding.

Co-authored-by: ant <ant@offline.click>
2026-02-26 11:32:47 +01:00
Admin
956471c1a6 counter splash example 2026-02-26 10:08:25 +01:00
admin
ddebd64601 api 2026-02-25 17:14:39 +01:00
offline-ant
825b824ef4 restore set_window_icon lost during rebase of #877 (#880)
The rebase squash into 6df7c870 used the early draft of window_icon.rs,
dropping the OnceLock-based global setter added in the fixup commit.

Restore from pre-rebase commit 83bf5d62:
- add static GLOBAL_ICON: OnceLock<WindowIcon>
- add pub fn set_window_icon(icon: WindowIcon)
- refactor default_window_icon() to check global override first
- re-export set_window_icon from platform lib.rs

Co-authored-by: ant <ant@offline.click>
2026-02-25 13:05:00 +01:00
Admin
c8ab367b14 little glitches in script engine 2026-02-24 23:32:56 +01:00
Admin
1ea87b2c2d warnings 2026-02-24 21:43:35 +01:00
Admin
aae121f31d fix gc issues 2026-02-24 21:40:08 +01:00
offline-ant
416ff1779a add cross-platform GL render bridge for external GL consumers (#878)
New GlRenderBridge API lets external code (e.g. servo in havi) render
via GL into a makepad-displayable texture with zero-copy.

Platform backends:
- Linux/Android: wraps existing EGL context (EglRenderBridge)
- Windows: ANGLE EGL on D3D11 device via mozangle (AngleRenderBridge)
- macOS: standalone CGL 3.2 Core bridged to Metal via IOSurface (CglRenderBridge)

Cx methods: create_gl_render_bridge, create_gl_render_bridge_texture,
restore_gl_context -- all platform-dispatched via cfg.

Co-authored-by: ant <ant@offline.click>
2026-02-24 17:32:08 +01:00
offline-ant
90415145a7 fix(wayland): negate scroll axis values to match Makepad convention (#875)
Wayland wl_pointer::Axis values are defined as motion-event vectors:
positive vertical = downward on screen. This means positive values
represent content sliding down under the pointer, i.e. the viewport
moving UP.

Makepad's internal scroll convention is positive = viewport moves DOWN.
This matches X11 (button 4/up maps to negative, button 5/down maps to
positive) and macOS (which negates scrollingDeltaY for the same reason).
The web backend also follows this via browser deltaY semantics.

The Wayland backend was passing axis values through without negation,
producing reversed scroll on all Wayland sessions. Negate at the
accumulator stage, consistent with how winit handles the same mismatch
(explicit comment: "Wayland sign convention is the inverse of winit").

The ignored AxisRelativeDirection event is unrelated -- it is a hint
telling clients whether the compositor applied natural-scrolling
inversion to the axis values, intended for widgets like volume sliders
that should track physical finger direction. The axis values themselves
already have natural scrolling applied by the compositor.

Co-authored-by: ant <ant@offline.click>
2026-02-24 17:31:04 +01:00
offline-ant
6df7c870db Add cross-platform window icon support (#877)
Add WindowIcon and WindowIconBuffer types to platform/src/window.rs with
RGBA8 pixel buffer data. Embed a default 64x64 Makepad icon generated at
runtime (dark rounded rect with white M glyph).

Platform backends:

- Windows: CreateIcon from RGBA->BGRA data, set on WNDCLASSEXW.hIcon
- X11: XChangeProperty with _NET_WM_ICON atom (RGBA->ARGB u32 array)
- macOS: NSBitmapImageRep + NSImage, setApplicationIconImage on NSApp
- Wayland: vendor xdg-toplevel-icon-v1 protocol, regenerate bindings,
  bind wl_shm + xdg_toplevel_icon_manager_v1 globals, create shm buffer
  icon when compositor supports it, silent fallback to app_id otherwise.
  Use configurable create_app_id field (default "Makepad").

Codegen: extend tools/wayland_codegen to generate xdg toplevel_icon
bindings into libs/linux/wayland-protocols/src/xdg.rs.

Co-authored-by: ant <ant@offline.click>
2026-02-24 17:30:43 +01:00
Admin
797098cec5 fix linux 2026-02-24 16:49:11 +01:00
Admin
1bf89646ef ssl sockets 2026-02-24 16:28:21 +01:00
Admin
0aa3533210 network refactor 2026-02-24 14:04:37 +01:00
Admin
582af4b271 splice out a makepad-network crate 2026-02-23 23:21:31 +01:00
Admin
251df9ebec fix dx11 memleak 2026-02-23 18:30:26 +01:00
offline-ant
b41f9eef42 platform: unified StudioToApp dispatch and control channel (#874)
* platform: unified StudioToApp dispatch and control channel

Shared dispatch_studio_msg() in cx_shared.rs handles all common
StudioToApp variants (input, clipboard, screenshot, widget dump, kill).
Each stdin backend resolves window_id for mouse events, then delegates.

Control channel (web_socket.rs) enables StudioToApp dispatch in windowed
apps. Event loops poll it alongside their native event sources.

WindowGeomChange events are emitted on stdin geometry updates.

* fix RunView Y-flip on Linux: flip in shader instead of CPU readback

---------

Co-authored-by: ant <ant@offline.click>
2026-02-23 17:46:41 +01:00
offline-ant
558eebb816 macOS IOSurface render texture support for havishell (#872)
Co-authored-by: ant <ant@offline.click>
2026-02-23 17:45:54 +01:00
offline-ant
e3eb1dab2a fix: map atan2 to atan in GLSL shader backend (#870)
Co-authored-by: ant <ant@offline.click>
2026-02-23 17:45:22 +01:00