Commit graph

19 commits

Author SHA1 Message Date
Admin
303945ea57 Studio: forward game controllers to the hosted app
A game was playable standalone and completely dead under Studio — which is
exactly where it gets developed. The cause is structural, not a binding: an
app hosted by Studio is a child process with no window of its own, so the
OS hands controller input to Studio and never to it. On macOS the child
never even reaches `init_cx_os`, so `apple_game_input` is None and
`game_input_states()` returns an empty slice forever.

So controllers now travel the same road mouse and key events already do.
`StudioToApp::GameInput` carries the whole controller set; the run view
polls its own `game_input_states` on the tick it already uses to batch
messages, and the app lands them in `Cx::game_input_remote`, which
`game_input_states()` reads whenever `in_makepad_studio` is set.

Details worth knowing:

- Sent on change only. A pad at rest reports identical level state every
  tick, and that is not worth the wire. The memo drops on focus loss so
  regaining focus resends rather than assuming the app still holds it.
- Only the focused run view forwards, so two open run views cannot both be
  driven by one stick. That is the rule the keyboard already follows.
- The set is replaced wholesale rather than merged, so a pad that unplugs
  disappears by being absent instead of freezing at its last state.
- Wheels ride along with gamepads. Forwarding only pads would have left a
  wheel silently dead under Studio while a pad worked, which is a worse
  failure than both being dead.
- Linux gains controllers under Studio that it does not have standalone:
  its native backend is a stub, but the forwarded path is platform-neutral.

The 21-field mapping lives in ONE place with both directions together.
Written per-side it would have drifted the first time a button was added —
one end gaining a field and the other quietly reporting zero for it. The
round-trip tests give every field a distinct value, because a fixture of
uniform numbers cannot detect two crossed wires, and the sticks are pinned
separately since flattening a Vec2 to scalars is where a swap would hide.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 20:30:29 +02:00
Admin
446a430dd7 ai mgr update 2026-04-28 18:25:08 +02:00
Admin
4a106111b8 ai manager otw 2026-04-28 12:24:40 +02:00
Admin
432ae0f8d7 aimgr 2026-04-27 14:51:24 +02:00
Admin
e19a79d5a4 mlx otw 2026-04-10 14:48:17 +02:00
Admin
69aa615947 mlx 5x->2x 2026-04-10 14:46:22 +02:00
Sabin Regmi
81034607d7 ft makepad_test (#974)
* ft makepad_test

* Improve run handling, manifest parsing, and stdout newline

Replace dynamic free-port lookup with an ephemeral localhost SocketAddr in test runtime and remove the unused find_free_listen_address helper. Ensure headless stdout messages end with a newline. Simplify send_to_app error handling and add a test that queued bootstrap messages are delivered once an app socket connects. Substantially enhance process_manager: unify cargo flag parsing, parse Cargo.toml to determine package/bin targets, resolve the correct binary name for direct stdio runs, and build the cargo/build+exec script from the resolved args. Add unit tests for manifest parsing and script generation and adjust related call sites.

* test harness

* Preserve test attrs; return Vec for gateway binds

In the test macro (libs/makepad_test/macros/src/lib.rs) preserve wrapper-only attributes (ignore and should_panic) on the generated wrapper test while removing them from the inner function. Added Attribute import, is_wrapper_only_test_attr helper, adjusted attribute filtering and emission, and added unit tests to verify attribute placement and expansion.

In the hub (studio/hub/src/hub.rs) change gateway_bind_candidates to return a Vec<SocketAddr> instead of an iterator and special-case ephemeral port 0 to preserve ephemeral binding; otherwise collect the range of candidate ports into a Vec. Added tests to validate candidate behavior. Also minor formatting/whitespace tweaks and a small IPv6 formatting adjustment.

* Add visible Studio mode and remote client

Enable running UI tests visibly through a running Makepad Studio. Adds a new makepad-network dependency and studio_remote client (libs/makepad_test/src/studio_remote.rs) and integrates it into the runtime via a TestConnection enum. Introduces visible-mode tooling: env vars (MAKEPAD_TEST_VISIBLE, MAKEPAD_TEST_STUDIO, MAKEPAD_TEST_STUDIO_MOUNT, MAKEPAD_TEST_STARTUP_DELAY_MS, MAKEPAD_TEST_ACTION_DELAY_MS, MAKEPAD_TEST_KEEP_OPEN_MS), pacing/delays after actions, and pause-before-shutdown. Splits startup into start_headless_app/start_visible_app, clears existing visible builds before launching, and updates tests, docs (GUIDE.md, README.md), and selector/runtime minor cleanups/formatting.
2026-03-25 16:09:03 +01:00
Admin
c29f03f00a protocol 2026-03-20 10:09:40 +01:00
Admin
2537b8caab protocol 2026-03-20 09:42:35 +01:00
Admin
9f445a6c69 cleanup 2026-03-19 10:16:38 +01:00
Admin
695403ef72 xr otw 2026-03-12 15:51:30 +01:00
Admin
bfd4a13648 fix 2026-03-11 18:15:12 +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
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