wayland: improve error when no seats have pointers

I don't know why that might be the case, but this error is better
than the unwrap.

refs: https://github.com/wez/wezterm/issues/3050
This commit is contained in:
Wez Furlong committed 2023-02-04 07:44:47 -07:00
1 parent b9739a24d1
commit 8ffcf546cf
1 file changed
+3 -1
+3 -1
View File
@@ -128,6 +128,8 @@ impl WaylandConnection {
}
}
}
let pointer =
pointer.ok_or_else(|| anyhow::anyhow!("no seats have an available pointer"))?;
let seat_listener;
{
@@ -188,7 +190,7 @@ impl WaylandConnection {
next_window_id: AtomicUsize::new(1),
windows: RefCell::new(HashMap::new()),
event_q: RefCell::new(event_q),
pointer: RefCell::new(pointer.unwrap()),
pointer: RefCell::new(pointer),
seat_listener,
mem_pool: RefCell::new(mem_pool),
gl_connection: RefCell::new(None),