From 50f38e2f766042e6014832d077467c6af471fb2e Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Mon, 13 Mar 2017 19:18:49 +0100 Subject: [PATCH] wayland: Update to wayland 0.8.6 --- Cargo.toml | 6 +++--- src/platform/linux/wayland/context.rs | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6da40521..fd12c13f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ kernel32-sys = "0.2" dwmapi-sys = "0.1" [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))'.dependencies] -wayland-client = { version = "0.7.4", features = ["dlopen"] } -wayland-kbd = "0.7.0" -wayland-window = "0.4.2" +wayland-client = { version = "0.8.6", features = ["dlopen"] } +wayland-kbd = "0.8.0" +wayland-window = "0.5.0" x11-dl = "2.8" diff --git a/src/platform/linux/wayland/context.rs b/src/platform/linux/wayland/context.rs index 1c3ca7eb..35092475 100644 --- a/src/platform/linux/wayland/context.rs +++ b/src/platform/linux/wayland/context.rs @@ -61,7 +61,7 @@ impl WaylandEnv { if version < 5 { panic!("Winit requires at least version 5 of the wl_seat global."); } - let seat = self.registry.bind::(5, name).expect("Seat cannot be destroyed"); + let seat = self.registry.bind::(5, name); return Some(seat) } } @@ -87,8 +87,7 @@ impl wl_registry::Handler for WaylandEnv { if interface == "wl_output" { // intercept outputs // this "expect" cannot trigger (see https://github.com/vberger/wayland-client-rs/issues/69) - let output = self.registry.bind::(1, name) - .expect("Registry cannot be dead"); + let output = self.registry.bind::(1, name); evqh.register::<_, WaylandEnv>(&output, self.my_id); self.monitors.push(OutputInfo::new(output, name)); } @@ -171,7 +170,7 @@ impl WaylandContext { }; // this "expect" cannot trigger (see https://github.com/vberger/wayland-client-rs/issues/69) - let registry = display.get_registry().expect("Display cannot be already destroyed."); + let registry = display.get_registry(); let env_id = event_queue.add_handler_with_init(WaylandEnv::new(registry)); // two syncs fully initialize event_queue.sync_roundtrip().expect("Wayland connection unexpectedly lost"); @@ -221,7 +220,7 @@ impl WaylandContext { let mut state = guard.state(); let env = state.get_mut_handler::(self.env_id); // this "expect" cannot trigger (see https://github.com/vberger/wayland-client-rs/issues/69) - let surface = Arc::new(env.inner.compositor.create_surface().expect("Compositor cannot be dead")); + let surface = Arc::new(env.inner.compositor.create_surface()); let decorated = wayland_window::DecoratedSurface::new( &*surface, 800, 600, &env.inner.compositor,