If Super+n is triggered while the Rust window manager is not managing any windows (for example, if it's the first keyboard shortcut triggered after startup), the window manager will crash. While it does seem silly to try to change the window focus when there aren't any windows, probably useful to do a small bit of work to prevent this. :)
This was my exact stack trace, for anyone curious:
debug(input): matched xkb binding
debug(wm): manage sequence start
thread 'main' (18005) panicked at library/alloc/src/collections/vec_deque/mod.rs:2992:9:
assertion failed: n <= self.len()
stack backtrace:
0: __rustc::rust_begin_unwind
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/std/src/panicking.rs:689:5
1: core::panicking::panic_fmt
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/core/src/panicking.rs:80:14
2: core::panicking::panic
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/core/src/panicking.rs:150:5
3: alloc::collections::vec_deque::VecDeque<T,A>::rotate_left
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/alloc/src/collections/vec_deque/mod.rs:2992:9
4: tinyrwm::Seat::do_action
at ./src/main.rs:427:29
5: tinyrwm::WindowManager::manage_seats
at ./src/main.rs:314:18
6: tinyrwm::WindowManager::handle_manage_start
at ./src/main.rs:150:14
7: <tinyrwm::AppData as wayland_client::event_queue::Dispatch<tinyrwm::river::river_window_manager_v1::RiverWindowManagerV1,()>>::event
at ./src/main.rs:612:26
8: wayland_client::event_queue::queue_callback
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:660:5
9: wayland_client::event_queue::EventQueue<State>::dispatching_impl
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:482:13
10: wayland_client::event_queue::EventQueue<State>::dispatch_pending
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:388:9
11: wayland_client::event_queue::EventQueue<State>::blocking_dispatch
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:410:14
12: tinyrwm::main
at ./src/main.rs:805:21
13: core::ops::function::FnOnce::call_once
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
If `Super`+`n` is triggered while the Rust window manager is not managing any windows (for example, if it's the first keyboard shortcut triggered after startup), the window manager will crash. While it does seem silly to try to change the window focus when there aren't any windows, probably useful to do a small bit of work to prevent this. :)
This was my exact stack trace, for anyone curious:
```
debug(input): matched xkb binding
debug(wm): manage sequence start
thread 'main' (18005) panicked at library/alloc/src/collections/vec_deque/mod.rs:2992:9:
assertion failed: n <= self.len()
stack backtrace:
0: __rustc::rust_begin_unwind
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/std/src/panicking.rs:689:5
1: core::panicking::panic_fmt
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/core/src/panicking.rs:80:14
2: core::panicking::panic
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/core/src/panicking.rs:150:5
3: alloc::collections::vec_deque::VecDeque<T,A>::rotate_left
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/alloc/src/collections/vec_deque/mod.rs:2992:9
4: tinyrwm::Seat::do_action
at ./src/main.rs:427:29
5: tinyrwm::WindowManager::manage_seats
at ./src/main.rs:314:18
6: tinyrwm::WindowManager::handle_manage_start
at ./src/main.rs:150:14
7: <tinyrwm::AppData as wayland_client::event_queue::Dispatch<tinyrwm::river::river_window_manager_v1::RiverWindowManagerV1,()>>::event
at ./src/main.rs:612:26
8: wayland_client::event_queue::queue_callback
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:660:5
9: wayland_client::event_queue::EventQueue<State>::dispatching_impl
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:482:13
10: wayland_client::event_queue::EventQueue<State>::dispatch_pending
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:388:9
11: wayland_client::event_queue::EventQueue<State>::blocking_dispatch
at /home/xxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wayland-client-0.31.14/src/event_queue.rs:410:14
12: tinyrwm::main
at ./src/main.rs:805:21
13: core::ops::function::FnOnce::call_once
at /builddir/build/BUILD/rust-1.96.0-build/rustc-1.96.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```