Unix fix attempt

This commit is contained in:
Pierre Krieger 2017-01-28 15:58:14 +01:00
parent 148f507272
commit 5025db2d59
2 changed files with 8 additions and 8 deletions

View file

@ -55,7 +55,7 @@ macro_rules! gen_api_transition {
} }
pub struct Window2 { pub struct Window2 {
window: ::std::sync::Arc<Window>, pub window: ::std::sync::Arc<Window>,
events_loop: ::std::sync::Weak<EventsLoop>, events_loop: ::std::sync::Weak<EventsLoop>,
} }

View file

@ -86,7 +86,7 @@ pub trait WindowExt {
impl WindowExt for Window { impl WindowExt for Window {
#[inline] #[inline]
fn get_xlib_window(&self) -> Option<*mut libc::c_void> { fn get_xlib_window(&self) -> Option<*mut libc::c_void> {
match self.window { match *self.window.window {
LinuxWindow::X(ref w) => Some(w.get_xlib_window()), LinuxWindow::X(ref w) => Some(w.get_xlib_window()),
_ => None _ => None
} }
@ -94,28 +94,28 @@ impl WindowExt for Window {
#[inline] #[inline]
fn get_xlib_display(&self) -> Option<*mut libc::c_void> { fn get_xlib_display(&self) -> Option<*mut libc::c_void> {
match self.window { match *self.window.window {
LinuxWindow::X(ref w) => Some(w.get_xlib_display()), LinuxWindow::X(ref w) => Some(w.get_xlib_display()),
_ => None _ => None
} }
} }
fn get_xlib_screen_id(&self) -> Option<*mut libc::c_void> { fn get_xlib_screen_id(&self) -> Option<*mut libc::c_void> {
match self.window { match *self.window.window {
LinuxWindow::X(ref w) => Some(w.get_xlib_screen_id()), LinuxWindow::X(ref w) => Some(w.get_xlib_screen_id()),
_ => None _ => None
} }
} }
fn get_xlib_xconnection(&self) -> Option<Arc<XConnection>> { fn get_xlib_xconnection(&self) -> Option<Arc<XConnection>> {
match self.window { match *self.window.window {
LinuxWindow::X(ref w) => Some(w.get_xlib_xconnection()), LinuxWindow::X(ref w) => Some(w.get_xlib_xconnection()),
_ => None _ => None
} }
} }
fn get_xcb_connection(&self) -> Option<*mut libc::c_void> { fn get_xcb_connection(&self) -> Option<*mut libc::c_void> {
match self.window { match *self.window.window {
LinuxWindow::X(ref w) => Some(w.get_xcb_connection()), LinuxWindow::X(ref w) => Some(w.get_xcb_connection()),
_ => None _ => None
} }
@ -136,7 +136,7 @@ impl WindowExt for Window {
#[inline] #[inline]
fn get_wayland_client_surface(&self) -> Option<&WlSurface> { fn get_wayland_client_surface(&self) -> Option<&WlSurface> {
match self.window { match *self.window.window {
LinuxWindow::Wayland(ref w) => Some(w.get_surface()), LinuxWindow::Wayland(ref w) => Some(w.get_surface()),
_ => None _ => None
} }
@ -144,7 +144,7 @@ impl WindowExt for Window {
#[inline] #[inline]
fn get_wayland_client_display(&self) -> Option<&WlDisplay> { fn get_wayland_client_display(&self) -> Option<&WlDisplay> {
match self.window { match *self.window.window {
LinuxWindow::Wayland(ref w) => Some(w.get_display()), LinuxWindow::Wayland(ref w) => Some(w.get_display()),
_ => None _ => None
} }