mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
X11: Fix deadlock when an error occurs during startup (#1475)
This commit is contained in:
parent
522a6e3298
commit
9999f53329
|
@ -584,13 +584,12 @@ impl<T: 'static> EventLoop<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_x11_any_thread() -> Result<EventLoop<T>, XNotSupported> {
|
pub fn new_x11_any_thread() -> Result<EventLoop<T>, XNotSupported> {
|
||||||
X11_BACKEND
|
let xconn = match X11_BACKEND.lock().as_ref() {
|
||||||
.lock()
|
Ok(xconn) => xconn.clone(),
|
||||||
.as_ref()
|
Err(err) => return Err(err.clone()),
|
||||||
.map(Arc::clone)
|
};
|
||||||
.map(x11::EventLoop::new)
|
|
||||||
.map(EventLoop::X)
|
Ok(EventLoop::X(x11::EventLoop::new(xconn)))
|
||||||
.map_err(|err| err.clone())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in a new issue