From 663c70cd52f4593a75d875a33803b78beec3eb81 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Sat, 9 Dec 2023 13:20:07 +0200 Subject: [PATCH] update wayrs --- Cargo.lock | 76 +++++++++++++++-------------------- Cargo.toml | 10 ++--- src/protocol.rs | 4 +- src/wm_info_provider/river.rs | 20 ++++----- 4 files changed, 51 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 516f7af..e4ddc78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,9 +69,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.8" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -79,9 +79,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstyle", "clap_lex", @@ -176,9 +176,9 @@ dependencies = [ [[package]] name = "gio" -version = "0.18.3" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d809baf02bdf1b5ef4ad3bf60dd9d4977149db4612b7bbb58e56aef168193b" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" dependencies = [ "futures-channel", "futures-core", @@ -208,9 +208,9 @@ dependencies = [ [[package]] name = "glib" -version = "0.18.3" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6" +checksum = "951bbd7fdc5c044ede9f05170f05a3ae9479239c3afdfe2d22d537a3add15c4e" dependencies = [ "bitflags", "futures-channel", @@ -307,9 +307,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "libc" @@ -371,9 +371,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "pango" @@ -446,11 +446,12 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" dependencies = [ - "toml_edit 0.20.7", + "toml_datetime", + "toml_edit", ] [[package]] @@ -655,41 +656,30 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap", "serde", @@ -718,9 +708,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wayrs-client" -version = "0.12.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc3c9d59922ad8871feca904dcc5980ef7ebe30ce271b11ae1dece12ed8f7c91" +checksum = "b58565212077ca8dc50b3f9d9802b7f2f90c4bad864e8047868da7770da2ba1f" dependencies = [ "nix", "thiserror", @@ -729,18 +719,18 @@ dependencies = [ [[package]] name = "wayrs-protocols" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f6a462aa49952d3b0210042f792fcbe83f4894a84da5dda6aed77fa58f8b718" +checksum = "fdb4eb7c8e41a9e18aa60f81b909434796adaf7cc2939d02e4d2ce01398108a1" dependencies = [ "wayrs-client", ] [[package]] name = "wayrs-scanner" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a6e537b7d99a704f4a9b05276a3bdf190ad349a20c125080b4ccd7e06a06c7" +checksum = "0c0ec7587724760d4ae8f65cc4e7e6c97cd28c333a5494518edf28f6450478ec" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -751,9 +741,9 @@ dependencies = [ [[package]] name = "wayrs-utils" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f8426a6cfedf5a25317e693fb1fa5154cfc4b327dfc74fa32382376635f977b" +checksum = "a9479c5fd1f276703a398c785664f5440011c07dc42cdc9260e264def1aad598" dependencies = [ "memmap2", "shmemfdrs", @@ -787,9 +777,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 5ff75e5..b9fab92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,11 @@ serde_json = "1" serde = { version = "1", features = ["derive"] } signal-hook = { version = "0.3", default-features = false } toml = { version = "0.8", default-features = false, features = ["parse"] } -wayrs-client = "0.12" -wayrs-protocols = { version = "0.12", features = ["wlr-layer-shell-unstable-v1", "viewporter", "fractional-scale-v1"] } -wayrs-utils = { version = "0.12", features = ["cursor", "shm_alloc", "seats"] } -clap = { version = "4.3.23", default-features = false, features = ["derive", "std", "help"] } -libc = "0.2.147" +wayrs-client = "1.0" +wayrs-protocols = { version = "0.13", features = ["wlr-layer-shell-unstable-v1", "viewporter", "fractional-scale-v1"] } +wayrs-utils = { version = "0.13", features = ["cursor", "shm_alloc", "seats"] } +clap = { version = "4.3", default-features = false, features = ["derive", "std", "help"] } +libc = "0.2" [profile.release] lto = "fat" diff --git a/src/protocol.rs b/src/protocol.rs index 5b30463..d8ac083 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -2,5 +2,5 @@ pub use wayrs_client::protocol::*; pub use wayrs_protocols::fractional_scale_v1::*; pub use wayrs_protocols::viewporter::*; pub use wayrs_protocols::wlr_layer_shell_unstable_v1::*; -wayrs_client::scanner::generate!("protocols/river-status-unstable-v1.xml"); -wayrs_client::scanner::generate!("protocols/river-control-unstable-v1.xml"); +wayrs_client::generate!("protocols/river-status-unstable-v1.xml"); +wayrs_client::generate!("protocols/river-control-unstable-v1.xml"); diff --git a/src/wm_info_provider/river.rs b/src/wm_info_provider/river.rs index 6c0993b..1d705c3 100644 --- a/src/wm_info_provider/river.rs +++ b/src/wm_info_provider/river.rs @@ -1,7 +1,8 @@ use std::ffi::CString; -use wayrs_client::{cstr, Connection}; -use wayrs_client::{global::*, EventCtx}; +use wayrs_client::global::*; +use wayrs_client::proxy::Proxy; +use wayrs_client::{cstr, Connection, EventCtx}; use super::*; use crate::state::State; @@ -34,19 +35,20 @@ impl RiverInfoProvider { globals: &Globals, config: &WmConfig, ) -> Option { - let status_manager = globals.bind(conn, 1..=4).ok()?; - let wl_seat: WlSeat = globals.bind(conn, ..).ok()?; // river supports just one seat + let status_manager: ZriverStatusManagerV1 = globals.bind(conn, 1..=4).ok()?; + let wl_seat: WlSeat = globals.bind(conn, ..=5).ok()?; // river supports just one seat + let seat_status = + status_manager.get_river_seat_status_with_cb(conn, wl_seat, seat_status_cb); + if wl_seat.version() >= 5 { + wl_seat.release(conn); + } Some(Self { status_manager, control: globals.bind(conn, 1).ok()?, output_statuses: Vec::new(), max_tag: config.river.max_tag, seat_status: SeatStatus { - _status: status_manager.get_river_seat_status_with_cb( - conn, - wl_seat, - seat_status_cb, - ), + _status: seat_status, mode: None, }, })