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

11 lines
414 B
TOML
Raw Normal View History

🎉 Phase 7.2 — wl_seat + wl_keyboard + wl_pointer routing input Capture preuve : docs/phase7-2-input-routing.png — fenêtre client xdg_toplevel 480x320 (damier turquoise) à (60,60), compositor stable pendant que les keyboard events transitent en parallèle. Validation runtime exhaustive : tous les events injectés via QEMU sendkey/mouse_button arrivent au client via wl_keyboard.key / wl_pointer.button : [client-input] wl_keyboard.key key=54 Pressed ← 'c' [client-input] wl_keyboard.key key=50 Pressed ← shift [client-input] wl_keyboard.key key=38 Pressed ← 'a' avec shift [client-input] wl_keyboard.key key=37 Pressed ← ctrl ... Modifications redox-wl-wayland-frontend : - + dep redox-wl-input (pour InputEvent type) - wl_seat global v7 avec capabilities = Pointer | Keyboard - wl_seat.name = "redox-wl-seat0" (v2+) - Dispatch wl_seat : GetPointer, GetKeyboard, GetTouch (no-op), Release ; au get_keyboard envoie keymap NoKeymap + repeat_info - Dispatch wl_pointer / wl_keyboard / wl_touch : Release retire la resource de state.{pointers,keyboards} - forward_input(InputEvent) public method qui broadcast wl_keyboard.key, wl_pointer.motion/button/axis/frame aux clients - set_focus(surface) public method qui envoie keyboard/pointer enter/leave events sur changement de focus - Tracking : focused_surface, cursor_x/y, next_input_serial, input_time_ms, pointers/keyboards Vec<Resource> Modif wl_surface.commit : appelle set_focus(Some(_resource)) pour que la dernière surface commitée reçoive l'enter automatiquement (politique simple 7.2, à raffiner en 7.4). Modif compositor binaire (redox-wl-compositor) : - Forward chaque InputEvent au frontend.forward_input(&ev) - Esc reste géré côté compositor pour exit propre Bin redox-wl-test-client-input ajouté (~280 lignes) : - Bind wl_compositor + wl_shm + xdg_wm_base + wl_seat - get_keyboard + get_pointer après reception caps - Crée xdg_toplevel + buffer ARGB damier turquoise - Log chaque wl_keyboard.{enter,leave,key,modifiers,repeat_info} et wl_pointer.{enter,leave,motion,button,axis} - Boucle event_queue : flush + prepare_read.read + dispatch_pending (CORRECT pattern pour wayland-rs ; le bug initial était d'utiliser juste dispatch_pending qui ne lit pas le socket) Critère de fin 7.2 validé : un client qui bind wl_seat reçoit keyboard events via wl_keyboard.key sans panic serveur. Limitations connues (sous-tickets ultérieurs) : - Keymap NoKeymap (pas de XKB layout) — 7.2 utilise scancodes raw - Broadcast à tous les keyboards/pointers (pas de filtrage par client focus) — multi-client viendra en 7.6 - Pas de pointer.motion testé (besoin -device usb-tablet QEMU) - Pas de validation modifier state (juste enter envoie 0,0,0,0) Image Redox restaurée à boot Orbital normal. Phrase reprise 7.3 : > Reprendre au commit XXX : Phase 7.3 curseur software. Dessiner un > sprite curseur 16x16 par-dessus la composition, position basée sur > InputBackend cursor_x/y. Hot-spot configurable via wl_pointer.set_cursor > (déjà no-op à 7.2). Tester avec usb-tablet QEMU pour avoir motion absolu. Leyoda 2026 – GPLv3
2026-05-09 15:05:03 +02:00
[package]
name = "redox-wl-test-client-input"
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 }
wayland-protocols = { path = "../../../wayland-rs/wayland-protocols", default-features = false, features = ["client"] }
libc = "0.2"