redox-wayland-compositor/crates/redox-wl-test-client-shm/Cargo.toml

11 lines
412 B
TOML
Raw Normal View History

🎉🎉🎉 Phase 6.4 — Wayland complet : un client externe affiche ses pixels Capture preuve : docs/phase6-4-wayland-client-surface.png — pattern ARGB 320x240 écrit par un binaire client Wayland externe affiché par notre compositor sur le framebuffer Redox dans QEMU. Crates ajoutés : redox-wl-wayland-frontend (lib, ~430 lignes) : - WaylandFrontend struct avec SurfaceRegistry intégré + Display<Self> + ListeningSocket - bind_absolute(path), accept_pending_clients(), dispatch_clients(), flush_clients(), notify_frame_done() - ShmPool : mmap + munmap on drop - BufferData : Arc<Mutex<ShmPool>> + offset/w/h/stride/format - SurfaceData : Arc<...> qui contient SurfaceId + pending_buffer + pending_frame_callbacks - Dispatch impls : wl_compositor v5, wl_shm v1 (advertise ARGB+XRGB), wl_shm_pool, wl_buffer, wl_surface (attach/damage/commit/frame/destroy), wl_callback, wl_region (no-op) Sémantique commit : copy-on-commit (lit pixels via mmap, copie dans SurfaceBuffer owned). Plus simple que de garder le mmap vivant. Au commit, raise auto la surface (politique simple). redox-wl-compositor (bin, ~150 lignes) : - ouvre RedoxOutput + InputBackend partagé - bind WaylandFrontend sur /tmp/redox-wl-comp.sock - export WAYLAND_DISPLAY env var - boucle main 30 fps : accept clients → dispatch → input → render → notify_frame_done → flush - Esc = exit propre redox-wl-test-client-shm (bin, ~170 lignes) : - attente du socket compositor (50 retries × 100ms) - Connection::from_backend après UnixStream::connect - Dispatch handlers minimal pour wl_registry, compositor, shm, pool, buffer, surface - shm_open + ftruncate + mmap + pattern ARGB déterministe (orange + bandes diagonales) - shm.create_pool(fd) + pool.create_buffer + compositor.create_surface - surface.attach + damage_buffer + commit - reste connecté 25s pour qu'on capture l'écran Validation runtime : compositor en init VT=2, client lancé en parallèle via 30_console. Logs serial montrent toute la séquence : [client] globals : compositor=true shm=true [client] shm créé, peint 320x240 ARGB [client] surface attach + damage + commit envoyés [comp] tick=30 surfaces=1 elapsed=1.2s [comp] tick=510 surfaces=1 elapsed=20.7s ← surface persiste 20+s PNG capturée à T+12s montre la surface du client visible sur le framebuffer. Position (0,0) parce que xdg-shell absent (placement absent). Reportable phase 7. Image Redox restaurée à boot Orbital normal. docs/phase6-4-wayland-frontend.md : compte-rendu complet, archi, sémantique commit, limitations, plan phase 7. Phase 6 entièrement close. Le compositor naissant fonctionne avec un vrai client Wayland externe sur Redox. Leyoda 2026 – GPLv3
2026-05-09 13:30:05 +02:00
[package]
name = "redox-wl-test-client-shm"
version = "0.1.0"
edition = "2021"
[dependencies]
wayland-client = { path = "../../../wayland-rs/wayland-client", default-features = false }
wayland-backend = { path = "../../../wayland-rs/wayland-backend", default-features = false }
🎉 Phase 7.1 — xdg-shell minimal validé runtime Capture preuve : docs/phase7-1-xdg-toplevel.png — fenêtre 320x240 du client externe positionnée à (60, 60) par le compositor (cascade par défaut), avec bandes verticales arc-en-ciel + bordure noire 2px. Différence visuelle vs phase 6.4 : la fenêtre est maintenant positionnée par le compositor (pas plaquée à 0,0). Modifications redox-wl-wayland-frontend : - + dep wayland-protocols (feature server) - xdg_wm_base global v5 - XdgSurfaceData { wl_surface, last_serial, acked_serial } - XdgToplevelData { title, app_id } - SurfaceData.xdg_pending_initial_configure : bloque l'affichage tant que ack-configure pas reçu (sémantique xdg-shell standard) - WaylandFrontend.next_xdg_serial : counter monotone serial - WaylandFrontend.next_toplevel_index : cascade position +60 par fenêtre - DEFAULT_TOPLEVEL_SIZE = 640x480 envoyé en initial configure - Dispatch xdg_wm_base : GetXdgSurface, CreatePositioner (no-op), Pong (no-op), Destroy (no-op) - Dispatch xdg_positioner + xdg_popup : no-op (out of scope) - Dispatch xdg_surface : - GetToplevel → cascade pos + envoie xdg_toplevel.configure(640,480) + xdg_surface.configure(serial) - AckConfigure(serial) → enregistre + débloque affichage - Destroy → cache la surface - Dispatch xdg_toplevel : - SetTitle / SetAppId → stocke - tout le reste ignoré (move, resize, maximized, ...) redox-wl-test-client-shm adapté : - + dep wayland-protocols (feature client) - bind 3 globals : wl_compositor, wl_shm, xdg_wm_base - Dispatch XdgWmBase::Event::Ping → pong (au cas où) - Dispatch XdgSurface::Event::Configure → store serial - Dispatch XdgToplevel::Event::Configure / Close → log - Workflow runtime : 1. create_surface + get_xdg_surface + get_toplevel 2. set_title / set_app_id 3. surface.commit (initial empty) 4. attente Configure event (timeout 5s) 5. ack_configure(serial) 6. shm + buffer + attach + commit POST-ack 7. boucle 25s 8. destroy propre Init submodule wayland-rs/wayland-protocols/protocols (XML files gitlab.freedesktop.org/wayland/wayland-protocols). Validation runtime QEMU complète : [client] globals : compositor=true shm=true xdg_wm_base=true [client] xdg_toplevel configure suggéré : 640x480 [client] initial configure reçu, serial=1 [client] ack_configure(1) [client] buffer attach + damage + commit POST-ack [comp] tick=30..450 surfaces=1 elapsed=1.2..18.2s PNG capturée à T+14s : surface visible à (60,60), bandes RGB+jaune+ violet+orange comme attendu. Critère de fin 7.1 validé : client xdg-shell crée toplevel, reçoit configure, ack, commit, affiche via shm, sans panic serveur, 18s stable, destroy propre. Limitations connues : focus, cursor, move/resize, multi-client, robustesse — sous-tickets 7.2-7.7. Image Redox restaurée à boot Orbital normal. docs/phase7-1-xdg-shell.md : compte-rendu complet, cycle de vie, limitations, plan 7.2. Leyoda 2026 – GPLv3
2026-05-09 14:34:45 +02:00
wayland-protocols = { path = "../../../wayland-rs/wayland-protocols", default-features = false, features = ["client"] }
🎉🎉🎉 Phase 6.4 — Wayland complet : un client externe affiche ses pixels Capture preuve : docs/phase6-4-wayland-client-surface.png — pattern ARGB 320x240 écrit par un binaire client Wayland externe affiché par notre compositor sur le framebuffer Redox dans QEMU. Crates ajoutés : redox-wl-wayland-frontend (lib, ~430 lignes) : - WaylandFrontend struct avec SurfaceRegistry intégré + Display<Self> + ListeningSocket - bind_absolute(path), accept_pending_clients(), dispatch_clients(), flush_clients(), notify_frame_done() - ShmPool : mmap + munmap on drop - BufferData : Arc<Mutex<ShmPool>> + offset/w/h/stride/format - SurfaceData : Arc<...> qui contient SurfaceId + pending_buffer + pending_frame_callbacks - Dispatch impls : wl_compositor v5, wl_shm v1 (advertise ARGB+XRGB), wl_shm_pool, wl_buffer, wl_surface (attach/damage/commit/frame/destroy), wl_callback, wl_region (no-op) Sémantique commit : copy-on-commit (lit pixels via mmap, copie dans SurfaceBuffer owned). Plus simple que de garder le mmap vivant. Au commit, raise auto la surface (politique simple). redox-wl-compositor (bin, ~150 lignes) : - ouvre RedoxOutput + InputBackend partagé - bind WaylandFrontend sur /tmp/redox-wl-comp.sock - export WAYLAND_DISPLAY env var - boucle main 30 fps : accept clients → dispatch → input → render → notify_frame_done → flush - Esc = exit propre redox-wl-test-client-shm (bin, ~170 lignes) : - attente du socket compositor (50 retries × 100ms) - Connection::from_backend après UnixStream::connect - Dispatch handlers minimal pour wl_registry, compositor, shm, pool, buffer, surface - shm_open + ftruncate + mmap + pattern ARGB déterministe (orange + bandes diagonales) - shm.create_pool(fd) + pool.create_buffer + compositor.create_surface - surface.attach + damage_buffer + commit - reste connecté 25s pour qu'on capture l'écran Validation runtime : compositor en init VT=2, client lancé en parallèle via 30_console. Logs serial montrent toute la séquence : [client] globals : compositor=true shm=true [client] shm créé, peint 320x240 ARGB [client] surface attach + damage + commit envoyés [comp] tick=30 surfaces=1 elapsed=1.2s [comp] tick=510 surfaces=1 elapsed=20.7s ← surface persiste 20+s PNG capturée à T+12s montre la surface du client visible sur le framebuffer. Position (0,0) parce que xdg-shell absent (placement absent). Reportable phase 7. Image Redox restaurée à boot Orbital normal. docs/phase6-4-wayland-frontend.md : compte-rendu complet, archi, sémantique commit, limitations, plan phase 7. Phase 6 entièrement close. Le compositor naissant fonctionne avec un vrai client Wayland externe sur Redox. Leyoda 2026 – GPLv3
2026-05-09 13:30:05 +02:00
libc = "0.2"