Update dependencies
This commit is contained in:
parent
3cc89dcf6e
commit
782b21f363
18
Cargo.toml
18
Cargo.toml
|
@ -18,25 +18,25 @@ cgmath = "0.18.0"
|
||||||
dbus = { version = "0.9.0", optional = true }
|
dbus = { version = "0.9.0", optional = true }
|
||||||
downcast-rs = "1.2.0"
|
downcast-rs = "1.2.0"
|
||||||
drm-fourcc = "^2.1.1"
|
drm-fourcc = "^2.1.1"
|
||||||
drm = { version = "0.4.0", optional = true }
|
drm = { version = "0.5.0", optional = true }
|
||||||
drm-ffi = { version = "0.1.0", optional = true }
|
drm-ffi = { version = "0.2.0", optional = true }
|
||||||
gbm = { version = "0.6.0", optional = true, default-features = false, features = ["drm-support"] }
|
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 }
|
input = { version = "0.6", default-features = false, features=["libinput_1_14"], optional = true }
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
libc = "0.2.70"
|
libc = "0.2.70"
|
||||||
libseat= { version = "0.1.1", optional = true }
|
libseat= { version = "0.1.1", optional = true }
|
||||||
libloading = "0.7.0"
|
libloading = "0.7.0"
|
||||||
nix = "0.20"
|
nix = "0.22"
|
||||||
slog = "2"
|
slog = "2"
|
||||||
slog-stdlog = { version = "4", optional = true }
|
slog-stdlog = { version = "4", optional = true }
|
||||||
tempfile = { version = "3.0", optional = true }
|
tempfile = { version = "3.0", optional = true }
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
udev = { version = "0.6", optional = true }
|
udev = { version = "0.6", optional = true }
|
||||||
wayland-commons = { version = "0.28.6", optional = true }
|
wayland-commons = { version = "0.29.0", optional = true }
|
||||||
wayland-egl = { version = "0.28.6", optional = true }
|
wayland-egl = { version = "0.29.0", optional = true }
|
||||||
wayland-protocols = { version = "0.28.6", features = ["unstable_protocols", "server"], optional = true }
|
wayland-protocols = { version = "0.29.0", features = ["unstable_protocols", "server"], optional = true }
|
||||||
wayland-server = { version = "0.28.6", optional = true }
|
wayland-server = { version = "0.29.0", optional = true }
|
||||||
wayland-sys = { version = "0.28.6", optional = true }
|
wayland-sys = { version = "0.29.0", optional = true }
|
||||||
winit = { version = "0.25.0", optional = true }
|
winit = { version = "0.25.0", optional = true }
|
||||||
xkbcommon = "0.4.0"
|
xkbcommon = "0.4.0"
|
||||||
scan_fmt = { version = "0.2", default-features = false }
|
scan_fmt = { version = "0.2", default-features = false }
|
||||||
|
|
|
@ -8,12 +8,12 @@ edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
input = { version = "0.5.0", features = ["udev"], optional = true }
|
input = { version = "0.6.0", features = ["udev"], optional = true }
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
xcursor = { version = "0.3.3", optional = true }
|
xcursor = { version = "0.3.3", optional = true }
|
||||||
image = { version = "0.23.14", default-features = false, optional = true }
|
image = { version = "0.23.14", default-features = false, optional = true }
|
||||||
fps_ticker = { version = "1.0.0", optional = true }
|
fps_ticker = { version = "1.0.0", optional = true }
|
||||||
rand = "0.7"
|
rand = "0.8"
|
||||||
slog = { version = "2.1.1" }
|
slog = { version = "2.1.1" }
|
||||||
slog-term = "2.8"
|
slog-term = "2.8"
|
||||||
slog-async = "2.2"
|
slog-async = "2.2"
|
||||||
|
@ -28,7 +28,7 @@ features = [ "renderer_gl", "backend_egl", "wayland_frontend", "slog-stdlog" ]
|
||||||
|
|
||||||
[dependencies.x11rb]
|
[dependencies.x11rb]
|
||||||
optional = true
|
optional = true
|
||||||
version = "0.7"
|
version = "0.8"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = [ "composite" ]
|
features = [ "composite" ]
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ impl X11State {
|
||||||
// Actually become the WM by redirecting some operations
|
// Actually become the WM by redirecting some operations
|
||||||
conn.change_window_attributes(
|
conn.change_window_attributes(
|
||||||
screen.root,
|
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.
|
// 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,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
WindowClass::InputOutput,
|
WindowClass::INPUT_OUTPUT,
|
||||||
x11rb::COPY_FROM_PARENT,
|
x11rb::COPY_FROM_PARENT,
|
||||||
&Default::default(),
|
&Default::default(),
|
||||||
)?;
|
)?;
|
||||||
conn.set_selection_owner(win, atoms.WM_S0, x11rb::CURRENT_TIME)?;
|
conn.set_selection_owner(win, atoms.WM_S0, x11rb::CURRENT_TIME)?;
|
||||||
|
|
||||||
// XWayland wants us to do this to function properly...?
|
// 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()?;
|
conn.flush()?;
|
||||||
|
|
||||||
|
@ -133,10 +133,10 @@ impl X11State {
|
||||||
Event::ConfigureRequest(r) => {
|
Event::ConfigureRequest(r) => {
|
||||||
// Just grant the wish
|
// Just grant the wish
|
||||||
let mut aux = ConfigureWindowAux::default();
|
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);
|
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);
|
aux = aux.sibling(r.sibling);
|
||||||
}
|
}
|
||||||
if r.value_mask & u16::from(ConfigWindow::X) != 0 {
|
if r.value_mask & u16::from(ConfigWindow::X) != 0 {
|
||||||
|
@ -145,13 +145,13 @@ impl X11State {
|
||||||
if r.value_mask & u16::from(ConfigWindow::Y) != 0 {
|
if r.value_mask & u16::from(ConfigWindow::Y) != 0 {
|
||||||
aux = aux.y(i32::try_from(r.y).unwrap());
|
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());
|
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());
|
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());
|
aux = aux.border_width(u32::try_from(r.border_width).unwrap());
|
||||||
}
|
}
|
||||||
self.conn.configure_window(r.window, &aux)?;
|
self.conn.configure_window(r.window, &aux)?;
|
||||||
|
|
|
@ -376,10 +376,7 @@ impl Session for DirectSession {
|
||||||
|
|
||||||
impl AsErrno for NixError {
|
impl AsErrno for NixError {
|
||||||
fn as_errno(&self) -> Option<i32> {
|
fn as_errno(&self) -> Option<i32> {
|
||||||
match *self {
|
Some(*self as i32)
|
||||||
NixError::Sys(errno) => Some(errno as i32),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,8 @@ use std::{
|
||||||
|
|
||||||
use wayland_protocols::unstable::linux_dmabuf::v1::server::{
|
use wayland_protocols::unstable::linux_dmabuf::v1::server::{
|
||||||
zwp_linux_buffer_params_v1::{
|
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,
|
zwp_linux_dmabuf_v1,
|
||||||
};
|
};
|
||||||
|
@ -224,7 +225,7 @@ where
|
||||||
width: i32,
|
width: i32,
|
||||||
height: i32,
|
height: i32,
|
||||||
format: u32,
|
format: u32,
|
||||||
flags: u32,
|
flags: BufferFlags,
|
||||||
ddata: DispatchData<'a>,
|
ddata: DispatchData<'a>,
|
||||||
) {
|
) {
|
||||||
// Cannot reuse a params:
|
// Cannot reuse a params:
|
||||||
|
@ -260,7 +261,11 @@ where
|
||||||
return;
|
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);
|
let planes = std::mem::take(&mut self.pending_planes);
|
||||||
for (i, plane) in planes.into_iter().enumerate() {
|
for (i, plane) in planes.into_iter().enumerate() {
|
||||||
let offset = plane.offset;
|
let offset = plane.offset;
|
||||||
|
@ -309,7 +314,7 @@ where
|
||||||
width: i32,
|
width: i32,
|
||||||
height: i32,
|
height: i32,
|
||||||
format: u32,
|
format: u32,
|
||||||
flags: u32,
|
flags: BufferFlags,
|
||||||
ddata: DispatchData<'a>,
|
ddata: DispatchData<'a>,
|
||||||
) {
|
) {
|
||||||
// Cannot reuse a params:
|
// Cannot reuse a params:
|
||||||
|
@ -345,7 +350,11 @@ where
|
||||||
return;
|
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);
|
let planes = ::std::mem::take(&mut self.pending_planes);
|
||||||
for (i, plane) in planes.into_iter().enumerate() {
|
for (i, plane) in planes.into_iter().enumerate() {
|
||||||
let offset = plane.offset;
|
let offset = plane.offset;
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::{
|
||||||
|
|
||||||
use slog::{debug, info, warn};
|
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
|
/// Find a free X11 display slot and setup
|
||||||
pub(crate) fn prepare_x11_sockets(log: ::slog::Logger) -> Result<(X11Lock, [UnixStream; 2]), std::io::Error> {
|
pub(crate) fn prepare_x11_sockets(log: ::slog::Logger) -> Result<(X11Lock, [UnixStream; 2]), std::io::Error> {
|
||||||
|
@ -74,7 +74,7 @@ impl X11Lock {
|
||||||
.parse::<i32>()
|
.parse::<i32>()
|
||||||
.map_err(|_| ())?,
|
.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
|
// no process whose pid equals the contents of the lockfile exists
|
||||||
// remove the lockfile and try grabbing it again
|
// remove the lockfile and try grabbing it again
|
||||||
if let Ok(()) = ::std::fs::remove_file(filename) {
|
if let Ok(()) = ::std::fs::remove_file(filename) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ use std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
cell::RefCell,
|
cell::RefCell,
|
||||||
env,
|
env,
|
||||||
io::{Error as IOError, Read, Result as IOResult},
|
io::{Read, Result as IOResult},
|
||||||
os::unix::{
|
os::unix::{
|
||||||
io::{AsRawFd, IntoRawFd, RawFd},
|
io::{AsRawFd, IntoRawFd, RawFd},
|
||||||
net::UnixStream,
|
net::UnixStream,
|
||||||
|
@ -61,8 +61,6 @@ use calloop::{
|
||||||
|
|
||||||
use slog::{error, info, o};
|
use slog::{error, info, o};
|
||||||
|
|
||||||
use nix::Error as NixError;
|
|
||||||
|
|
||||||
use wayland_server::{Client, Display, Filter};
|
use wayland_server::{Client, Display, Filter};
|
||||||
|
|
||||||
use super::x11_sockets::{prepare_x11_sockets, X11Lock};
|
use super::x11_sockets::{prepare_x11_sockets, X11Lock};
|
||||||
|
@ -420,21 +418,12 @@ fn spawn_xwayland(
|
||||||
Ok(child.stdout.take().expect("stdout should be piped"))
|
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`
|
/// Remove the `O_CLOEXEC` flag from this `Fd`
|
||||||
///
|
///
|
||||||
/// This means that the `Fd` will *not* be automatically
|
/// This means that the `Fd` will *not* be automatically
|
||||||
/// closed when we `exec()` into XWayland
|
/// closed when we `exec()` into XWayland
|
||||||
fn unset_cloexec(fd: RawFd) -> IOResult<()> {
|
fn unset_cloexec(fd: RawFd) -> IOResult<()> {
|
||||||
use nix::fcntl::{fcntl, FcntlArg, FdFlag};
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue