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>
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>
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>
* Fix draw_svg to support a rotated Icon. Add `IconRotated` widget.
Fix icon resource paths in `splash` example
* Expose geometry in draw_svg to make icon/svg rotation more efficient
simplifies the code too
The rebase squash into 26318769 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>
* Remove left margin from window caption label
Delete the hardcoded Inset{left: 100} margin on the caption Label in widgets/src/window.rs so the label can be centered by the parent layout. This cleans up alignment and removes an unnecessary offset in the window header.
* Use window title in caption; format button click
Apply the configured window title to the window caption and make a small UI code cleanup.
- examples/splash: set window.title to "Splash Example" and reformat the tooltip button click check to a multiline expression for readability.
- widgets/src/window.rs: import label::* and update ensure_initialized to copy cx.windows[window_id].create_title into the caption_label when non-empty so the window chrome shows the configured title.
The CalloutTooltip is a fancier wrapper atop Tooltip that allows
the user to display a tooltip with a callout triangle that points
at a particular widget, making it clearer what the tooltip
corresponds to. It also supports a custom text color, background color,
positioning suggestion (top, right, left, bottom), full text wrapping,
and dynamically resize and re-orient itself to fit within the app screen.
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>
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>
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>
* 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>
accept_host_endpoint() has a 10s timeout. Calling it at spawn time
fails for any build that takes longer to compile. Defer to when
"Running " appears in stderr, which is when the binary actually
starts and connects to the aux channel.
build_server: match+return instead of expect on spawn failure.
Co-authored-by: ant <ant@offline.click>