Commit graph

10 commits

Author SHA1 Message Date
Till Wegmueller
a7ad184774 Use EventLoopProxy for efficient frame wake instead of busy-poll
Replace ControlFlow::Poll (CPU-hungry busy loop) with an
EventLoopProxy that the network thread uses to wake the winit
event loop only when a new frame arrives. Zero CPU when idle,
instant wake on new frames.
2026-04-07 19:49:33 +02:00
Till Wegmueller
b805f9f6c8 Fix typing lag: use ControlFlow::Poll for continuous frame updates
The winit event loop defaulted to Wait mode, only processing frames
when user input arrived. Switch to Poll so the loop continuously
checks for new frames from the network thread.
2026-04-07 19:44:39 +02:00
Till Wegmueller
974511277b Fix keycode mapping, client disconnect, and server shutdown
- Keycodes: add +8 offset for XKB (evdev scancode + 8 = XKB keycode)
- Client: force exit on Cmd+Q/close (network thread may block)
- Server: force exit on Ctrl+C (network thread may block on accept)

Proper graceful shutdown with tokio CancellationToken deferred.
2026-04-07 19:37:41 +02:00
Till Wegmueller
fa6bb53142 Fix pixel format: pass ARGB8888 directly as BGRA8
On little-endian x86, ARGB8888 bytes in memory are [B,G,R,A] which
matches wgpu's Bgra8Unorm layout. No byte swapping needed.
2026-04-07 18:11:47 +02:00
Till Wegmueller
6b15ee819e Fix black screen: convert ARGB8888 to BGRA8 in client display
Server (PixmanRenderer) outputs ARGB8888, client GPU texture expects
BGRA8. Added byte-order conversion in update_frame(). Also changed
texture format from Bgra8UnormSrgb to Bgra8Unorm for correct colors.
2026-04-07 18:06:41 +02:00
Till Wegmueller
ab8f9e0d03 Support DNS hostnames in wrclient server address
resolve_server_addr() handles both IP:port and hostname:port via
std::net::ToSocketAddrs. Server name passed through for TLS SNI.
2026-04-07 17:59:22 +02:00
Till Wegmueller
43a4d7e6af Add missing display.rs and wrclient display dependencies
display.rs (winit + wgpu renderer) and Cargo.toml changes (winit,
wgpu, pollster, env_logger) were created but not committed in the
Task 5 subagent.
2026-04-07 17:51:40 +02:00
Till Wegmueller
eb8394d247 Add input forwarding from wrclient to wrsrvd
Implement client-side input capture (input.rs) that converts winit
WindowEvents to protocol InputMessages: keyboard via evdev keycode
mapping, pointer motion/buttons/axis. Wire into wrclient main.rs
event handler to send input over QUIC via the existing input channel.

Server-side: add inject_network_input() to WayRay state that accepts
protocol InputMessages and injects them into the Smithay seat, following
the same patterns as process_input_event for keyboard, pointer motion
with surface focus, click-to-focus, and axis scroll.

Also upgrade client frame handling to use persistent framebuffer with
XOR-diff decoding via wayray_protocol::encoding::apply_region.
2026-04-07 17:08:47 +02:00
Till Wegmueller
f79a934c2b Add QUIC transport layer with quinn for server and client
Implement QUIC networking for wrsrvd (server) and wrclient (client) using
quinn over rustls with self-signed certificates. Three logical channels:
control (bidirectional), display (server->client unidirectional), and
input (client->server unidirectional).

Server runs tokio in a background thread, communicating with the compositor
via std::sync::mpsc channels. Client exposes an async connect() API that
returns a ServerConnection with methods for sending input and receiving
frames.

Key design note: quinn streams are lazily materialized -- accept_bi/
accept_uni on the peer won't resolve until data is written. The handshake
protocol accounts for this by having each side write immediately after
opening streams.
2026-04-07 16:54:01 +02:00
Till Wegmueller
4e08dfb5a9 Set up Cargo workspace with four crates
Workspace: wrsrvd, wrclient, wayray-protocol, wradm under crates/.
Smithay configured with default-features=false, portable features only.
Implements ADR-007 project structure.
2026-04-04 18:16:53 +02:00