mirror of
https://github.com/CloudNebulaProject/wayray.git
synced 2026-04-10 21:20:40 +00:00
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.
This commit is contained in:
parent
c4e3920c79
commit
974511277b
3 changed files with 8 additions and 4 deletions
|
|
@ -125,8 +125,10 @@ impl ApplicationHandler for App {
|
||||||
) {
|
) {
|
||||||
match event {
|
match event {
|
||||||
WindowEvent::CloseRequested => {
|
WindowEvent::CloseRequested => {
|
||||||
info!("close requested, exiting");
|
info!("close requested, shutting down");
|
||||||
event_loop.exit();
|
event_loop.exit();
|
||||||
|
// Force exit since the network thread may be blocking.
|
||||||
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
WindowEvent::Resized(physical_size) => {
|
WindowEvent::Resized(physical_size) => {
|
||||||
if let Some(display) = &mut self.display {
|
if let Some(display) = &mut self.display {
|
||||||
|
|
|
||||||
|
|
@ -181,8 +181,9 @@ pub fn run(
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("headless backend shutting down");
|
info!("headless backend shutting down");
|
||||||
calloop_data.net_handle.shutdown();
|
// Force exit — the network thread may be blocking on accept().
|
||||||
Ok(())
|
// Proper graceful shutdown with tokio CancellationToken is a future improvement.
|
||||||
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Drain all pending network events (input, connection changes).
|
/// Drain all pending network events (input, connection changes).
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,10 @@ impl WayRay {
|
||||||
smithay::backend::input::KeyState::Released
|
smithay::backend::input::KeyState::Released
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// XKB keycodes = evdev scancode + 8
|
||||||
keyboard.input::<(), _>(
|
keyboard.input::<(), _>(
|
||||||
self,
|
self,
|
||||||
ev.keycode.into(),
|
(ev.keycode + 8).into(),
|
||||||
state,
|
state,
|
||||||
serial,
|
serial,
|
||||||
ev.time,
|
ev.time,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue