Commit graph

2,282 commits

Author SHA1 Message Date
Admin
af6d3fd094 testing x client 2026-04-01 12:19:02 +02:00
Admin
223cf39256 working emitters 2026-04-01 12:19:02 +02:00
Admin
1d1aed6de6 otw 2026-04-01 12:19:02 +02:00
Admin
6bd2d9153b xr networking 2026-04-01 12:19:02 +02:00
Admin
b7563a50c7 refactor 2026-04-01 12:19:02 +02:00
Kevin Boos
af7712a406 PortalList: fix drag scrolling over widgets that handle events/hits (#1002)
Previously, PortalList's drag scrolling straight up didn't work
when the initial FingerDown event (touch/tap/click) landed on a widget
that is "interactive", meaning it could handle events. Not sure when that
concept was introduced, but it's kinda flawed given that all widgets
just defaulted to being `true` (always interactive). But imo that goes
against the ethos of simple event handling based on ordering of calls to
`handle_event()`, not to mention the whole `capture_overload` thing.

I think this is the solution that we've always wanted. The PortalList itself
now tracks when it is scrolling (and only starts a scroll once it is sure
enough finger/mouse movement has occurred, `TAP_COUNT_DISTANCE`),
and it does not deliver these interactive events to child widgets
while it is scrolling. This will make things a lot easier for the app dev too,
since that's how iOS and Android work too.

Details of changes to `portal_list.rs`:

- Always enter `ScrollState::Drag` on FingerDown regardless of whether
  the touch point is over an interactive widget. A `committed` flag and
  `drag_scroll_threshold` (defaulting to `TAP_COUNT_DISTANCE`) gate
  when scroll deltas actually apply, preventing micro-scrolling during
  taps/clicks on interactive items.
- Suppress event forwarding to child widgets once a drag scroll commits
  (finger moves past threshold), so children don't receive stale
  interaction events during scrolling.
- Suppress event forwarding when a finger-down/click arrives while a
  scroll animation (flick, pulldown, etc.) is in progress, so tapping
  to stop a scroll doesn't also activate a child widget.
- Add configurable `drag_scroll_threshold` property to PortalList.
2026-04-01 08:40:06 +02:00
Kevin Boos
e8d1b217da Choose sane defaults for platform-specific title/caption bar config (#1000)
Primarily on Linux, ensure that we show the title/caption bar
and draw it within Makepad (i.e., client-side drawing) if the
DE/WM doesn't show it by default.
This should make things behave as expected on Linux X11 and Wayland
both.
2026-04-01 00:42:29 +02:00
Kevin Boos
f99b1d875a Fix title bar, captions label centering, and windows buttons (#999)
no app-level overrides are needed now.

1. on Windows, the windows buttons now behave and are drawn
   just like all other apps -- proper bg coloring on hover and down,
   and the right sizing.

2. and for the caption label, it is centered properly (by accounting
   for the size of the windows_buttons button set), and then when the
   window is too narrow, it is left-aligned in the remaining space
   to ensure that it stil looks good.
2026-03-31 08:58:06 +02:00
Kevin Boos
71ea8c130a Remove busy-wait loops on Linux (x11 and wayland) (#998)
Tested working with Robrix and a few makepad examples
2026-03-31 08:57:51 +02:00
Kevin Boos
fec9bb6f2e Introduce knowledge of device screen bounds/"safe inset areas" (#990)
* Introduce knowledge of device screen bounds/cutous/"safe inset areas"

Tested working on iOS, implemented for Android but not yet tested.

The approach may need to be improved, because it currently restricts
the whole app window to being fully within the safe areas.
We may not necessarily want that, or if we do, then we probably also
need to support setting the base color of the reserved system areas
(beneath the app bounds and above in the notification bar area).

* Use metal scissor rect to prevent SVGs/icons from being mis-drawn in safe areas

This prevents anything from being accidentally drawn in the safe
inset areas when the pass clear_color is transparent. Of course,
we can still draw the pass clear_color in those areas.

* Workaround: apply a scissor rect within safe inset area

Only apply it to clip any DrawSvg/DrawVector-specific draw calls
within the safe inset area.

This is unfortunately still just a hacky solution, because if we
actually do want to draw svg/vectors within that safe inset area,
then we won't be able to.

* Properly fix gpu artifacts when rendering SVGs

The `DrawSvg` vertex shader had a GPU fringe expansion pass designed for `fill_gpu()` mode, where fringe vertices encode per-vertex normals in the `v` and `stroke_dist` fields. SVG rendering used `fill_gpu()`, which produces **coincident-vertex fringe triangles** (body and outer fringe at the same CPU position, expanded on the GPU). These zero-area triangles caused **Metal GPU rasterization artifacts** — stray fragments appearing at unexpected screen positions.

**`draw/src/svg/render.rs`** — Switch SVG fill from `fill_gpu()` to `fill()`. Pre-computed fringe produces vertices at physically different positions (no coincident vertices).

**`draw/src/shader/draw_svg.rs`** — Remove the GPU fringe expansion code from the vertex shader. With pre-computed fringe, the `v` and `stroke_dist` fields are constants (`1.0` and `0.0`), not per-vertex normals. The expansion code was misinterpreting `v=1.0` as a horizontal normal, corrupting vertex positions.

**`libs/apple_sys/src/lib.rs`** — Added `MTLScissorRect` struct (unused now but available for future use).

**`src/home/rooms_sidebar.rs`** — Changed shadow offset from `vec2(1.0, 0.0)` to `vec2(0.0, 10.0)` so the `RoundedShadowView` shadow only draws below the header, eliminating the gray line at the top of the screen (issue 1).

* Expose safe area inset padding to app, don't forcibly apply it to root window

* Fixed safe area insets padding, with support for rotation

We now make these values available to the app dev (see below)
instead of forcibly inserting them as padding on all root windows.

This will allow each app to choose how and when they want to apply said pad values
(or if they want to at all) in an easy way, both at the Splash level
or more dynamically/programmatically at the Rust level.

Required quite a few changes to how things work in the iOS platform plumbing,
also described below in the generated summary:

On iOS and Android, Makepad apps render content behind device cutouts (Dynamic Island, camera notch), home indicators, and rounded screen corners because the framework has no awareness of safe area insets.

Added platform-level safe area inset querying on iOS and Android, exposed the values through both the Splash DSL (`mod.widgets.SAFE_INSET_PAD_*`) and Rust (`cx.display_context.safe_area_insets`), and ensured they update correctly on device rotation.

**New types:**
- `UIEdgeInsets` struct in `libs/apple_sys` for Objective-C interop
- `SafeAreaInsets` struct in `platform/src/event/window.rs` (top/right/bottom/left in logical points)
- Added `safe_area_insets` field to `WindowGeom` and `DisplayContext`

**iOS (`platform/src/os/apple/ios/`):**
- Query `[UIView safeAreaInsets]` from the MTKView in `check_window_geom()`
- Added `viewSafeAreaInsetsDidChange` callback on `MakepadViewController` to detect inset changes on rotation
- Populate `display_context` before `Event::Startup` so values are available during app script initialization
- Fixed MTKView setup: removed redundant `addSubview:` (conflicted with `setRootViewController:`) and added autoresizing mask — both required for safe area propagation on rotation

**Android (`platform/src/os/linux/android/`):**
- Added `SafeAreaInsets` variant to `FromJavaMessage` and corresponding JNI function
- Java side (`ResizingLayout.onApplyWindowInsets`): queries `WindowInsets.Type.systemBars() | displayCutout()` and sends insets to Rust (converted from px to dp)
- Added `safe_area_insets` field to `CxOs`, populated on `SafeAreaInsets` message and included in `WindowGeom` construction
- Added `surfaceOnSafeAreaInsets` native method to `MakepadNative.java`

**Splash DSL variables (`widgets/src/lib.rs`):**
- `mod.widgets.SAFE_INSET_PAD_TOP`
- `mod.widgets.SAFE_INSET_PAD_BOTTOM`
- `mod.widgets.SAFE_INSET_PAD_LEFT`
- `mod.widgets.SAFE_INSET_PAD_RIGHT`
- Values read from `display_context` at widget module initialization (during `Event::Startup`)
- Updated on the script heap via `Cx::update_safe_inset_script_values()` on `WindowGeomChange`

**Rotation support:**
- Added `pending_script_reapply` flag on `Cx` — set when safe area insets change, checked at the end of the platform event loop iteration
- Fires a deferred `LiveEdit` event to re-evaluate and re-apply all Splash widget definitions with updated inset values
- Implemented in both iOS and Android event loops

**StackNavigationView fix (`widgets/src/stack_navigation.rs`):**
- Full-screen stack views now position at `max(safe_area_insets.top, parent_rect.pos.y)` instead of hardcoded `y: 0`, respecting both mobile safe areas and desktop title bars

**All other platforms:**
- Added `..Default::default()` to all `WindowGeom` constructors (macOS, Windows, Linux X11/Wayland/Direct, web, tvOS, OpenHarmony) so the new `safe_area_insets` field defaults to zeros
2026-03-31 08:57:36 +02:00
Admin
307de4153c cleanup 2026-03-30 09:54:53 +02:00
Admin
808229c1c1 cleanup 2026-03-30 09:52:31 +02:00
Admin
0d507b2d81 cleanup 2026-03-30 09:22:56 +02:00
Admin
fae9971b79 lz4 opt 2026-03-30 01:06:33 +02:00
Admin
b3e81d466a missing 2026-03-30 00:55:55 +02:00
Admin
b2a36e1dd6 lz4 wire protocol 2026-03-30 00:55:33 +02:00
Admin
bccb69c04c cleanup 2026-03-29 23:33:47 +02:00
Admin
bf5882855d cleanup 2026-03-29 23:21:47 +02:00
Admin
85a485b463 cleanup 2026-03-29 22:57:11 +02:00
Admin
d077e864ce cleanup 2026-03-29 22:53:22 +02:00
Admin
7ac28493cd cleanup 2026-03-29 22:47:40 +02:00
Admin
ff07672927 optimize 2026-03-29 22:12:33 +02:00
Admin
00ef275b0c optimisations 2026-03-29 21:46:25 +02:00
Admin
32091a2a14 optimisations 2026-03-29 21:36:19 +02:00
Admin
618bcf11e7 optimisations 2026-03-29 21:01:06 +02:00
Admin
12bd874eda optimisations 2026-03-29 20:27:52 +02:00
Admin
d61b52d6df optimisations 2026-03-29 18:46:50 +02:00
Admin
49560cad25 optimisations 2026-03-29 18:42:48 +02:00
Admin
a37d4fe7b4 optimisations 2026-03-29 18:32:46 +02:00
Admin
de370867f2 fixing tracing 2026-03-29 18:12:16 +02:00
Admin
daed7da284 fixing tracing 2026-03-29 18:06:14 +02:00
Admin
b1cf71b573 deptmap tweaks 2026-03-29 15:47:27 +02:00
Admin
2812ad9d00 depth align trying 2026-03-29 11:10:52 +02:00
Admin
5ee9525d20 clean maps lock 2026-03-28 22:56:30 +01:00
Admin
bc945face2 refactor 2026-03-28 21:45:46 +01:00
Admin
4a51377484 fix refactor 2026-03-28 21:45:27 +01:00
Admin
5197904900 optimising 2026-03-28 20:11:51 +01:00
Admin
328424b710 optimising 2026-03-28 20:03:37 +01:00
Admin
aff2110422 optimising 2026-03-28 19:56:09 +01:00
Admin
42da283dbe working refactor 2026-03-28 18:46:43 +01:00
Admin
c9a7c15eeb working refactor 2026-03-28 17:58:49 +01:00
Admin
0c1465a9e2 actually working alignment 2026-03-28 16:36:27 +01:00
Admin
8dac4bcaad cleanup 2026-03-28 13:22:52 +01:00
Admin
2f33a8300c contour map 2026-03-28 12:03:05 +01:00
Admin
3e047d1567 contour map 2026-03-28 12:02:56 +01:00
Admin
b46501b70a auto alignment working 2026-03-27 16:31:02 +01:00
Admin
cf46675a32 xr room mapping 2026-03-27 13:51:54 +01:00
Admin
f23b2f9494 fix xr UIs 2026-03-26 15:25:55 +01:00
Admin
3d16b00083 wrist ui 2026-03-26 15:25:55 +01:00
wyenox
28a90f211d fix openxr compile error on non-vulkan android builds (#989) 2026-03-26 08:25:25 +01:00