Skip to content

Commit 6dad07d

Browse files
committed
wip
1 parent be0d913 commit 6dad07d

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

src/platform/x11/error.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::platform::x11::drag_n_drop::ParseError;
22
use crate::platform::x11::xcb_connection::GetPropertyError;
33
use crate::tracing::warn;
44
use crate::wrappers::xlib::{DisplayOpenFailedError, InitThreadsFailedError};
5+
use crate::HandlerError;
56
use x11_dl::error::OpenError;
67
use x11rb::connection::RequestConnection;
78
use x11rb::cookie::{Cookie, VoidCookie};
@@ -20,6 +21,7 @@ pub enum Error {
2021
GetProperty(GetPropertyError),
2122
Connect(ConnectError),
2223
DisplayOpenFailed(DisplayOpenFailedError),
24+
Handler(HandlerError),
2325
#[cfg(feature = "opengl")]
2426
XLib(crate::wrappers::xlib::XLibError),
2527
#[cfg(feature = "opengl")]
@@ -74,6 +76,12 @@ impl From<X11Error> for Error {
7476
}
7577
}
7678

79+
impl From<HandlerError> for Error {
80+
fn from(value: HandlerError) -> Self {
81+
Self::Handler(value)
82+
}
83+
}
84+
7785
#[cfg(feature = "opengl")]
7886
impl From<crate::wrappers::xlib::XLibError> for Error {
7987
fn from(value: crate::wrappers::xlib::XLibError) -> Self {

src/platform/x11/gl.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@ pub enum CreationFailedError {
2020
OpenError(OpenError),
2121
}
2222

23-
impl From<XLibError> for GlError {
24-
fn from(e: XLibError) -> Self {
25-
GlError::CreationFailed(CreationFailedError::X11Error(e))
26-
}
27-
}
28-
29-
impl From<OpenError> for GlError {
30-
fn from(e: OpenError) -> Self {
31-
GlError::CreationFailed(CreationFailedError::OpenError(e))
32-
}
33-
}
34-
3523
pub type GlContext = Rc<GlContextInner>;
3624

3725
pub struct GlContextInner {

src/platform/x11/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl Window {
164164
gl_context,
165165
));
166166

167-
let handler = build.build(WindowContext::new(Rc::clone(&inner)));
167+
let handler = build.build(WindowContext::new(Rc::clone(&inner)))?;
168168

169169
let _ = tx.send(Ok(window_id));
170170

0 commit comments

Comments
 (0)