File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use crate::platform::x11::drag_n_drop::ParseError;
22use crate :: platform:: x11:: xcb_connection:: GetPropertyError ;
33use crate :: tracing:: warn;
44use crate :: wrappers:: xlib:: { DisplayOpenFailedError , InitThreadsFailedError } ;
5+ use crate :: HandlerError ;
56use x11_dl:: error:: OpenError ;
67use x11rb:: connection:: RequestConnection ;
78use 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" ) ]
7886impl From < crate :: wrappers:: xlib:: XLibError > for Error {
7987 fn from ( value : crate :: wrappers:: xlib:: XLibError ) -> Self {
Original file line number Diff line number Diff 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-
3523pub type GlContext = Rc < GlContextInner > ;
3624
3725pub struct GlContextInner {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments