Update dependencies
This commit is contained in:
parent
9bbf6db11c
commit
3c48ab1c7f
1381
Cargo.lock
generated
1381
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -10,11 +10,3 @@ members = [
|
|||||||
"systemd",
|
"systemd",
|
||||||
"xcb-xembed",
|
"xcb-xembed",
|
||||||
]
|
]
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
# git source needed until extension event error resolution fix is released
|
|
||||||
xcb = { git = "https://github.com/rust-x-bindings/rust-xcb", rev = "d09b5f91bc07d56673f1bc0d6c7ecd72b5ff7b3e" }
|
|
||||||
# xkb package depends on xcb 0.9
|
|
||||||
xkb = { git = "https://github.com/kelnos/rust-xkb", branch = "xcb-1.x" }
|
|
||||||
# Build error in v0.7.5 when x11 feature enabled
|
|
||||||
ffi = { package = "xkbcommon-sys", git = "https://github.com/kelnos/rust-xkbcommon-sys", branch = "release-0.7.x" }
|
|
||||||
|
@ -5,11 +5,11 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
async-std = { version = "1.11", features = ["attributes"] }
|
async-std = { version = "1", features = ["attributes"] }
|
||||||
async-xcb = { path = "../async-xcb" }
|
async-xcb = { path = "../async-xcb" }
|
||||||
bscreensaver-command = { path = "../command" }
|
bscreensaver-command = { path = "../command" }
|
||||||
bscreensaver-util = { path = "../util" }
|
bscreensaver-util = { path = "../util" }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
xcb = { version = "1", features = ["dpms"] }
|
xcb = { version = "1", features = ["dpms"] }
|
||||||
zbus = "2"
|
zbus = "3"
|
||||||
|
@ -50,4 +50,5 @@ log = "0.4"
|
|||||||
nix = "0.23"
|
nix = "0.23"
|
||||||
xcb = { version = "1", features = ["randr", "xkb", "xfixes", "xinput"] }
|
xcb = { version = "1", features = ["randr", "xkb", "xfixes", "xinput"] }
|
||||||
xcb-xembed = { path = "../xcb-xembed" }
|
xcb-xembed = { path = "../xcb-xembed" }
|
||||||
xkb = { version = "0.2", features = ["x11"] }
|
xkb = { version = "0.3", features = ["x11"] }
|
||||||
|
xkbcommon-sys = { version = "1", feature = "x11" }
|
||||||
|
@ -2,6 +2,7 @@ pub(crate) mod monitor;
|
|||||||
pub(crate) mod pidfd;
|
pub(crate) mod pidfd;
|
||||||
pub mod screensaver;
|
pub mod screensaver;
|
||||||
pub mod subservice;
|
pub mod subservice;
|
||||||
|
pub mod xkb_ext;
|
||||||
|
|
||||||
use log::{debug, info};
|
use log::{debug, info};
|
||||||
use xcb::{x, XidNew};
|
use xcb::{x, XidNew};
|
||||||
|
@ -21,7 +21,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
use xcb::{randr, x, xfixes, xinput};
|
use xcb::{randr, x, xfixes, xinput};
|
||||||
|
|
||||||
use bscreensaver::{screensaver::{BlankerState, CommandHandlers, Screensaver}, subservice::Subservices};
|
use bscreensaver::{screensaver::{BlankerState, CommandHandlers, Screensaver}, subservice::Subservices, xkb_ext};
|
||||||
use bscreensaver_util::{*, settings::Configuration};
|
use bscreensaver_util::{*, settings::Configuration};
|
||||||
|
|
||||||
const BLANKED_ARG: &str = "blanked";
|
const BLANKED_ARG: &str = "blanked";
|
||||||
@ -71,7 +71,7 @@ fn main() -> anyhow::Result<()> {
|
|||||||
init_xfixes(&conn)?;
|
init_xfixes(&conn)?;
|
||||||
init_xinput(&conn)?;
|
init_xinput(&conn)?;
|
||||||
init_randr(&conn)?;
|
init_randr(&conn)?;
|
||||||
xkb::x11::setup(&conn, xkb::x11::MIN_MAJOR_XKB_VERSION, xkb::x11::MIN_MINOR_XKB_VERSION, xkb::x11::NO_FLAGS)
|
xkb_ext::x11_setup(&conn, xkb::x11::MIN_MAJOR_XKB_VERSION, xkb::x11::MIN_MINOR_XKB_VERSION)
|
||||||
.map_err(|_| anyhow::anyhow!("Failed to initialize XKB extension"))?;
|
.map_err(|_| anyhow::anyhow!("Failed to initialize XKB extension"))?;
|
||||||
|
|
||||||
let helper_dir = PathBuf::from(env!("HELPER_DIR"));
|
let helper_dir = PathBuf::from(env!("HELPER_DIR"));
|
||||||
|
28
locker/src/xkb_ext.rs
Normal file
28
locker/src/xkb_ext.rs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
use std::mem::MaybeUninit;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn x11_setup(connection: &xcb::Connection, major_version: u16, minor_version: u16) -> Result<(u16, u16, u8, u8), ()> {
|
||||||
|
let mut actual_major = MaybeUninit::uninit();
|
||||||
|
let mut actual_minor = MaybeUninit::uninit();
|
||||||
|
let mut base_event = MaybeUninit::uninit();
|
||||||
|
let mut base_error = MaybeUninit::uninit();
|
||||||
|
|
||||||
|
let ret = unsafe {
|
||||||
|
xkbcommon_sys::xkb_x11_setup_xkb_extension(
|
||||||
|
connection.get_raw_conn() as *mut _,
|
||||||
|
major_version,
|
||||||
|
minor_version,
|
||||||
|
xkbcommon_sys::XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS,
|
||||||
|
actual_major.as_mut_ptr(),
|
||||||
|
actual_minor.as_mut_ptr(),
|
||||||
|
base_event.as_mut_ptr(),
|
||||||
|
base_error.as_mut_ptr()
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
if ret != 1 {
|
||||||
|
Err(())
|
||||||
|
} else {
|
||||||
|
Ok(unsafe { (actual_major.assume_init(), actual_minor.assume_init(), base_event.assume_init(), base_error.assume_init()) })
|
||||||
|
}
|
||||||
|
}
|
@ -13,5 +13,5 @@ futures = "0.3"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
nix = "0.23"
|
nix = "0.23"
|
||||||
xcb = "1"
|
xcb = "1"
|
||||||
zbus = "2.2"
|
zbus = "3"
|
||||||
logind-zbus = "3"
|
logind-zbus = "3"
|
||||||
|
@ -16,4 +16,4 @@ shell-words = "1"
|
|||||||
toml = "0.5"
|
toml = "0.5"
|
||||||
xcb = "1"
|
xcb = "1"
|
||||||
xdg = "2"
|
xdg = "2"
|
||||||
zbus = "2"
|
zbus = "3"
|
||||||
|
Loading…
Reference in New Issue
Block a user