Skip to content

Commit fdedda3

Browse files
committed
On X11, fix error propagation in EventLoop::new
Fixes #3350.
1 parent cf0a533 commit fdedda3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Unreleased` header.
1111

1212
# Unreleased
1313

14+
- On X11, fix `NotSupported` error not propagated when creating event loop.
1415
- On Wayland, fix resize not issued when scale changes
1516
- On X11 and Wayland, fix arrow up on keypad reported as `ArrowLeft`.
1617

src/platform_impl/linux/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ impl<T: 'static> EventLoop<T> {
784784
#[cfg(wayland_platform)]
785785
Backend::Wayland => EventLoop::new_wayland_any_thread().map_err(Into::into),
786786
#[cfg(x11_platform)]
787-
Backend::X => Ok(EventLoop::new_x11_any_thread().unwrap()),
787+
Backend::X => EventLoop::new_x11_any_thread().map_err(Into::into),
788788
}
789789
}
790790

@@ -794,10 +794,10 @@ impl<T: 'static> EventLoop<T> {
794794
}
795795

796796
#[cfg(x11_platform)]
797-
fn new_x11_any_thread() -> Result<EventLoop<T>, XNotSupported> {
797+
fn new_x11_any_thread() -> Result<EventLoop<T>, EventLoopError> {
798798
let xconn = match X11_BACKEND.lock().unwrap().as_ref() {
799799
Ok(xconn) => xconn.clone(),
800-
Err(err) => return Err(err.clone()),
800+
Err(_) => return Err(EventLoopError::NotSupported(NotSupportedError::new())),
801801
};
802802

803803
Ok(EventLoop::X(x11::EventLoop::new(xconn)))

0 commit comments

Comments
 (0)