From 782b21f3636b186c54a3b0408d419c92476fa659 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Sat, 24 Jul 2021 20:30:00 +0200 Subject: [PATCH] Update dependencies --- Cargo.toml | 18 +++++++++--------- anvil/Cargo.toml | 6 +++--- anvil/src/xwayland/mod.rs | 16 ++++++++-------- src/backend/session/direct.rs | 5 +---- src/wayland/dmabuf/mod.rs | 19 ++++++++++++++----- src/xwayland/x11_sockets.rs | 4 ++-- src/xwayland/xserver.rs | 15 ++------------- 7 files changed, 39 insertions(+), 44 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 78d3cfd..d14ae5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,25 +18,25 @@ cgmath = "0.18.0" dbus = { version = "0.9.0", optional = true } downcast-rs = "1.2.0" drm-fourcc = "^2.1.1" -drm = { version = "0.4.0", optional = true } -drm-ffi = { version = "0.1.0", optional = true } -gbm = { version = "0.6.0", optional = true, default-features = false, features = ["drm-support"] } +drm = { version = "0.5.0", optional = true } +drm-ffi = { version = "0.2.0", optional = true } +gbm = { version = "0.7.0", optional = true, default-features = false, features = ["drm-support"] } input = { version = "0.6", default-features = false, features=["libinput_1_14"], optional = true } lazy_static = "1" libc = "0.2.70" libseat= { version = "0.1.1", optional = true } libloading = "0.7.0" -nix = "0.20" +nix = "0.22" slog = "2" slog-stdlog = { version = "4", optional = true } tempfile = { version = "3.0", optional = true } thiserror = "1" udev = { version = "0.6", optional = true } -wayland-commons = { version = "0.28.6", optional = true } -wayland-egl = { version = "0.28.6", optional = true } -wayland-protocols = { version = "0.28.6", features = ["unstable_protocols", "server"], optional = true } -wayland-server = { version = "0.28.6", optional = true } -wayland-sys = { version = "0.28.6", optional = true } +wayland-commons = { version = "0.29.0", optional = true } +wayland-egl = { version = "0.29.0", optional = true } +wayland-protocols = { version = "0.29.0", features = ["unstable_protocols", "server"], optional = true } +wayland-server = { version = "0.29.0", optional = true } +wayland-sys = { version = "0.29.0", optional = true } winit = { version = "0.25.0", optional = true } xkbcommon = "0.4.0" scan_fmt = { version = "0.2", default-features = false } diff --git a/anvil/Cargo.toml b/anvil/Cargo.toml index 14538e0..4bb079f 100644 --- a/anvil/Cargo.toml +++ b/anvil/Cargo.toml @@ -8,12 +8,12 @@ edition = "2018" [dependencies] bitflags = "1.2.1" -input = { version = "0.5.0", features = ["udev"], optional = true } +input = { version = "0.6.0", features = ["udev"], optional = true } thiserror = "1" xcursor = { version = "0.3.3", optional = true } image = { version = "0.23.14", default-features = false, optional = true } fps_ticker = { version = "1.0.0", optional = true } -rand = "0.7" +rand = "0.8" slog = { version = "2.1.1" } slog-term = "2.8" slog-async = "2.2" @@ -28,7 +28,7 @@ features = [ "renderer_gl", "backend_egl", "wayland_frontend", "slog-stdlog" ] [dependencies.x11rb] optional = true -version = "0.7" +version = "0.8" default-features = false features = [ "composite" ] diff --git a/anvil/src/xwayland/mod.rs b/anvil/src/xwayland/mod.rs index 3102ccc..a2d2b44 100644 --- a/anvil/src/xwayland/mod.rs +++ b/anvil/src/xwayland/mod.rs @@ -89,7 +89,7 @@ impl X11State { // Actually become the WM by redirecting some operations conn.change_window_attributes( screen.root, - &ChangeWindowAttributesAux::default().event_mask(EventMask::SubstructureRedirect), + &ChangeWindowAttributesAux::default().event_mask(EventMask::SUBSTRUCTURE_REDIRECT), )?; // Tell XWayland that we are the WM by acquiring the WM_S0 selection. No X11 clients are accepted before this. @@ -104,14 +104,14 @@ impl X11State { 1, 1, 0, - WindowClass::InputOutput, + WindowClass::INPUT_OUTPUT, x11rb::COPY_FROM_PARENT, &Default::default(), )?; conn.set_selection_owner(win, atoms.WM_S0, x11rb::CURRENT_TIME)?; // XWayland wants us to do this to function properly...? - conn.composite_redirect_subwindows(screen.root, Redirect::Manual)?; + conn.composite_redirect_subwindows(screen.root, Redirect::MANUAL)?; conn.flush()?; @@ -133,10 +133,10 @@ impl X11State { Event::ConfigureRequest(r) => { // Just grant the wish let mut aux = ConfigureWindowAux::default(); - if r.value_mask & u16::from(ConfigWindow::StackMode) != 0 { + if r.value_mask & u16::from(ConfigWindow::STACK_MODE) != 0 { aux = aux.stack_mode(r.stack_mode); } - if r.value_mask & u16::from(ConfigWindow::Sibling) != 0 { + if r.value_mask & u16::from(ConfigWindow::SIBLING) != 0 { aux = aux.sibling(r.sibling); } if r.value_mask & u16::from(ConfigWindow::X) != 0 { @@ -145,13 +145,13 @@ impl X11State { if r.value_mask & u16::from(ConfigWindow::Y) != 0 { aux = aux.y(i32::try_from(r.y).unwrap()); } - if r.value_mask & u16::from(ConfigWindow::Width) != 0 { + if r.value_mask & u16::from(ConfigWindow::WIDTH) != 0 { aux = aux.width(u32::try_from(r.width).unwrap()); } - if r.value_mask & u16::from(ConfigWindow::Height) != 0 { + if r.value_mask & u16::from(ConfigWindow::HEIGHT) != 0 { aux = aux.height(u32::try_from(r.height).unwrap()); } - if r.value_mask & u16::from(ConfigWindow::BorderWidth) != 0 { + if r.value_mask & u16::from(ConfigWindow::BORDER_WIDTH) != 0 { aux = aux.border_width(u32::try_from(r.border_width).unwrap()); } self.conn.configure_window(r.window, &aux)?; diff --git a/src/backend/session/direct.rs b/src/backend/session/direct.rs index 38a4534..7da6621 100644 --- a/src/backend/session/direct.rs +++ b/src/backend/session/direct.rs @@ -376,10 +376,7 @@ impl Session for DirectSession { impl AsErrno for NixError { fn as_errno(&self) -> Option { - match *self { - NixError::Sys(errno) => Some(errno as i32), - _ => None, - } + Some(*self as i32) } } diff --git a/src/wayland/dmabuf/mod.rs b/src/wayland/dmabuf/mod.rs index 358f720..5497710 100644 --- a/src/wayland/dmabuf/mod.rs +++ b/src/wayland/dmabuf/mod.rs @@ -49,7 +49,8 @@ use std::{ use wayland_protocols::unstable::linux_dmabuf::v1::server::{ zwp_linux_buffer_params_v1::{ - Error as ParamError, Request as ParamsRequest, ZwpLinuxBufferParamsV1 as BufferParams, + Error as ParamError, Flags as BufferFlags, Request as ParamsRequest, + ZwpLinuxBufferParamsV1 as BufferParams, }, zwp_linux_dmabuf_v1, }; @@ -224,7 +225,7 @@ where width: i32, height: i32, format: u32, - flags: u32, + flags: BufferFlags, ddata: DispatchData<'a>, ) { // Cannot reuse a params: @@ -260,7 +261,11 @@ where return; } - let mut buf = Dmabuf::builder((width, height), format, DmabufFlags::from_bits_truncate(flags)); + let mut buf = Dmabuf::builder( + (width, height), + format, + DmabufFlags::from_bits_truncate(flags.bits()), + ); let planes = std::mem::take(&mut self.pending_planes); for (i, plane) in planes.into_iter().enumerate() { let offset = plane.offset; @@ -309,7 +314,7 @@ where width: i32, height: i32, format: u32, - flags: u32, + flags: BufferFlags, ddata: DispatchData<'a>, ) { // Cannot reuse a params: @@ -345,7 +350,11 @@ where return; } - let mut buf = Dmabuf::builder((width, height), format, DmabufFlags::from_bits_truncate(flags)); + let mut buf = Dmabuf::builder( + (width, height), + format, + DmabufFlags::from_bits_truncate(flags.bits()), + ); let planes = ::std::mem::take(&mut self.pending_planes); for (i, plane) in planes.into_iter().enumerate() { let offset = plane.offset; diff --git a/src/xwayland/x11_sockets.rs b/src/xwayland/x11_sockets.rs index ca6db2f..7416e66 100644 --- a/src/xwayland/x11_sockets.rs +++ b/src/xwayland/x11_sockets.rs @@ -5,7 +5,7 @@ use std::{ use slog::{debug, info, warn}; -use nix::{errno::Errno, sys::socket, Error as NixError, Result as NixResult}; +use nix::{errno::Errno, sys::socket, Result as NixResult}; /// Find a free X11 display slot and setup pub(crate) fn prepare_x11_sockets(log: ::slog::Logger) -> Result<(X11Lock, [UnixStream; 2]), std::io::Error> { @@ -74,7 +74,7 @@ impl X11Lock { .parse::() .map_err(|_| ())?, ); - if let Err(NixError::Sys(Errno::ESRCH)) = ::nix::sys::signal::kill(pid, None) { + if let Err(Errno::ESRCH) = ::nix::sys::signal::kill(pid, None) { // no process whose pid equals the contents of the lockfile exists // remove the lockfile and try grabbing it again if let Ok(()) = ::std::fs::remove_file(filename) { diff --git a/src/xwayland/xserver.rs b/src/xwayland/xserver.rs index e50bbca..97a9210 100644 --- a/src/xwayland/xserver.rs +++ b/src/xwayland/xserver.rs @@ -42,7 +42,7 @@ use std::{ any::Any, cell::RefCell, env, - io::{Error as IOError, Read, Result as IOResult}, + io::{Read, Result as IOResult}, os::unix::{ io::{AsRawFd, IntoRawFd, RawFd}, net::UnixStream, @@ -61,8 +61,6 @@ use calloop::{ use slog::{error, info, o}; -use nix::Error as NixError; - use wayland_server::{Client, Display, Filter}; use super::x11_sockets::{prepare_x11_sockets, X11Lock}; @@ -420,21 +418,12 @@ fn spawn_xwayland( Ok(child.stdout.take().expect("stdout should be piped")) } -fn nix_error_to_io(err: NixError) -> IOError { - use std::io::ErrorKind; - match err { - NixError::Sys(errno) => errno.into(), - NixError::InvalidPath | NixError::InvalidUtf8 => IOError::new(ErrorKind::InvalidInput, err), - NixError::UnsupportedOperation => IOError::new(ErrorKind::Other, err), - } -} - /// Remove the `O_CLOEXEC` flag from this `Fd` /// /// This means that the `Fd` will *not* be automatically /// closed when we `exec()` into XWayland fn unset_cloexec(fd: RawFd) -> IOResult<()> { use nix::fcntl::{fcntl, FcntlArg, FdFlag}; - fcntl(fd, FcntlArg::F_SETFD(FdFlag::empty())).map_err(nix_error_to_io)?; + fcntl(fd, FcntlArg::F_SETFD(FdFlag::empty()))?; Ok(()) }