From b19fafa1a0b14cee7ac98b7dc59eb6046d6f8d30 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Sat, 24 Jun 2017 10:31:36 +0200 Subject: [PATCH] Update winit dependency --- Cargo.toml | 10 ++++----- src/backend/winit.rs | 50 +++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 772bdd9..855f6a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,17 +5,17 @@ authors = ["Victor Berger "] license = "MIT" [dependencies] -wayland-server = "0.9.4" +wayland-server = "0.9.9" nix = "0.7.0" xkbcommon = "0.2.1" tempfile = "2.1.5" slog = { version = "2.0.0" } slog-stdlog = "2.0.0-0.2" libloading = "0.4.0" -wayland-client = { version = "~0.8.6", optional = true } -winit = { git = "https://github.com/tomaka/winit.git", optional = true } -glium = { version = "~0.16.0", optional = true, default-features = false } -input = { version = "~0.2.0", optional = true } +wayland-client = { version = "0.9.9", optional = true } +winit = { version = "0.7.0", optional = true } +glium = { version = "0.16.0", optional = true, default-features = false } +input = { version = "0.2.0", optional = true } clippy = { version = "*", optional = true } rental = "0.4.11" diff --git a/src/backend/winit.rs b/src/backend/winit.rs index 9f72f11..5fdb921 100644 --- a/src/backend/winit.rs +++ b/src/backend/winit.rs @@ -110,32 +110,30 @@ where let window = Rc::new(builder.build(&events_loop)?); debug!(log, "Window created"); - let (native_display, native_surface, surface) = - if let (Some(conn), Some(window)) = (get_x11_xconnection(), window.get_xlib_window()) { - debug!(log, "Window is backed by X11"); - ( - NativeDisplay::X11(conn.display as *const _), - NativeSurface::X11(window), - None, - ) - } else if let (Some(display), Some(surface)) = - ( - window.get_wayland_display(), - window.get_wayland_client_surface(), - ) - { - debug!(log, "Window is backed by Wayland"); - let (w, h) = window.get_inner_size().unwrap(); - let egl_surface = wegl::WlEglSurface::new(surface, w as i32, h as i32); - ( - NativeDisplay::Wayland(display), - NativeSurface::Wayland(egl_surface.ptr() as *const _), - Some(egl_surface), - ) - } else { - error!(log, "Window is backed by an unsupported graphics framework"); - return Err(CreationError::NotSupported); - }; + let (native_display, native_surface, surface) = if let (Some(conn), Some(window)) = + (get_x11_xconnection(), window.get_xlib_window()) + { + debug!(log, "Window is backed by X11"); + ( + NativeDisplay::X11(conn.display as *const _), + NativeSurface::X11(window), + None, + ) + } else if let (Some(display), Some(surface)) = + (window.get_wayland_display(), window.get_wayland_surface()) + { + debug!(log, "Window is backed by Wayland"); + let (w, h) = window.get_inner_size().unwrap(); + let egl_surface = unsafe { wegl::WlEglSurface::new_from_raw(surface as *mut _, w as i32, h as i32) }; + ( + NativeDisplay::Wayland(display), + NativeSurface::Wayland(egl_surface.ptr() as *const _), + Some(egl_surface), + ) + } else { + error!(log, "Window is backed by an unsupported graphics framework"); + return Err(CreationError::NotSupported); + }; let context = unsafe { match EGLContext::new(