From 4e3ca0959faa7c8211d064b4e7b7b0028911d530 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Tue, 22 Oct 2024 09:36:16 +0900 Subject: [PATCH] chore: bump to new zbus --- Cargo.lock | 78 +++++++++++++++++++++---------------------------- Cargo.toml | 4 +-- src/main.rs | 6 ++-- src/session.rs | 6 ++-- src/settings.rs | 4 +-- 5 files changed, 44 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66161a4..a26bde1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -212,9 +212,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" [[package]] name = "arrayref" @@ -1831,7 +1831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4429b0277a14ae9751350ad9b658b1be0abb5b54faa5bcdf6e74a3372582fad7" dependencies = [ "heck", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.71", @@ -2983,7 +2983,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 2.0.71", @@ -3587,11 +3587,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.22", ] [[package]] @@ -4556,17 +4556,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.22" @@ -5648,7 +5637,7 @@ dependencies = [ "wayland-protocols-misc", "wayland-protocols-wlr 0.3.4", "xkbcommon", - "zbus 4.4.0", + "zbus 5.0.1", ] [[package]] @@ -5755,9 +5744,9 @@ dependencies = [ [[package]] name = "zbus" -version = "4.4.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +checksum = "333be40ef37976542e10832ba961e3e44ea215a6b1e2673066b303ee3e0ede10" dependencies = [ "async-broadcast 0.7.1", "async-process 2.2.3", @@ -5766,24 +5755,21 @@ dependencies = [ "enumflags2", "event-listener 5.3.1", "futures-core", - "futures-sink", "futures-util", "hex", "nix 0.29.0", "ordered-stream", - "rand", "serde", "serde_repr", - "sha1", "static_assertions", "tokio", "tracing", "uds_windows", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "xdg-home", - "zbus_macros 4.4.0", - "zbus_names 3.0.0", - "zvariant 4.2.0", + "zbus_macros 5.0.1", + "zbus_names 4.0.0", + "zvariant 5.0.1", ] [[package]] @@ -5802,15 +5788,15 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.4.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +checksum = "381be624000c82e716c2a45d9213fabacf82177591fa8a6ff655d2825450601a" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.71", - "zvariant_utils 2.1.0", + "zvariant_utils 3.0.1", ] [[package]] @@ -5826,13 +5812,13 @@ dependencies = [ [[package]] name = "zbus_names" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +checksum = "cdc27fbd3593ff015cef906527a2ec4115e2e3dbf6204a24d952ac4975c80614" dependencies = [ "serde", "static_assertions", - "zvariant 4.2.0", + "zvariant 5.0.1", ] [[package]] @@ -5895,16 +5881,17 @@ dependencies = [ [[package]] name = "zvariant" -version = "4.2.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +checksum = "c690a1da8858fd4377b8cc3134a753b0bea1d8ebd78ad6e5897fab821c5e184e" dependencies = [ "endi", "enumflags2", "serde", "static_assertions", "url", - "zvariant_derive 4.2.0", + "zvariant_derive 5.0.1", + "zvariant_utils 3.0.1", ] [[package]] @@ -5922,15 +5909,15 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "4.2.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +checksum = "83b6ddc1fed08493e4f2bd9350e7d00a3383467228735f3f169a9f8820fde755" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.71", - "zvariant_utils 2.1.0", + "zvariant_utils 3.0.1", ] [[package]] @@ -5946,11 +5933,14 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +checksum = "6f8d85190ba70bc7b9540430df078bb529620b1464ed4a606010de584e27094d" dependencies = [ "proc-macro2", "quote", + "serde", + "static_assertions", "syn 2.0.71", + "winnow 0.6.20", ] diff --git a/Cargo.toml b/Cargo.toml index cd78eb6..8d04950 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = ["libs/screenshotdialog", "libs/accessdialog", "."] screenshotdialog = { path = "libs/screenshotdialog" } accessdialog = { path = "libs/accessdialog" } -zbus = { version = "4", default-features = false, features = ["tokio", "url"] } +zbus = { version = "5", default-features = false, features = ["tokio", "url"] } tokio = { version = "1.40.0", features = ["full"] } serde = { version = "1.0.210", features = ["derive"] } tracing = "0.1.40" @@ -26,7 +26,7 @@ image = { version = "0.25", default-features = false, features = [ bitflags = "2.6.0" enumflags2 = "0.7.10" -anyhow = "1.0.89" +anyhow = "1.0.90" # pipewire pipewire = "0.8.0" diff --git a/src/main.rs b/src/main.rs index ea7ef1d..cd36178 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use settings::{AccentColor, SettingsBackend, SettingsConfig, SETTING_CONFIG}; use std::collections::HashMap; use std::future::pending; -use zbus::{zvariant, Connection, ConnectionBuilder, SignalContext}; +use zbus::{connection, object_server::SignalEmitter, zvariant, Connection}; use futures::{ channel::mpsc::{channel, Receiver}, @@ -93,7 +93,7 @@ async fn async_watch>(path: P) -> notify::Result<()> { let (mut watcher, mut rx) = async_watcher()?; let signal_context = - SignalContext::new(&connection, "/org/freedesktop/portal/desktop").unwrap(); + SignalEmitter::new(&connection, "/org/freedesktop/portal/desktop").unwrap(); // Add a path to be watched. All files and directories at that path and // below will be monitored for changes. watcher.watch(path.as_ref(), RecursiveMode::Recursive)?; @@ -133,7 +133,7 @@ async fn main() -> anyhow::Result<()> { tracing_subscriber::fmt().init(); tracing::info!("luminous Start"); - let conn = ConnectionBuilder::session()? + let conn = connection::Builder::session()? .name("org.freedesktop.impl.portal.desktop.luminous")? .serve_at("/org/freedesktop/portal/desktop", AccessBackend)? .serve_at("/org/freedesktop/portal/desktop", ScreenShotBackend)? diff --git a/src/session.rs b/src/session.rs index 6c87ea7..111c469 100644 --- a/src/session.rs +++ b/src/session.rs @@ -1,5 +1,5 @@ use enumflags2::{bitflags, BitFlags}; -use zbus::{interface, zvariant::OwnedObjectPath, SignalContext}; +use zbus::{interface, object_server::SignalEmitter, zvariant::OwnedObjectPath}; use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -156,7 +156,7 @@ impl Session { impl Session { async fn close( &self, - #[zbus(signal_context)] cxts: SignalContext<'_>, + #[zbus(signal_emitter)] cxts: SignalEmitter<'_>, #[zbus(object_server)] server: &zbus::ObjectServer, ) -> zbus::fdo::Result<()> { server @@ -173,5 +173,5 @@ impl Session { } #[zbus(signal)] - async fn closed(signal_ctxt: &SignalContext<'_>, message: &str) -> zbus::Result<()>; + async fn closed(signal_ctxt: &SignalEmitter<'_>, message: &str) -> zbus::Result<()>; } diff --git a/src/settings.rs b/src/settings.rs index d06aed5..188f78c 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,6 +1,6 @@ mod config; use tokio::sync::Mutex; -use zbus::{fdo, interface, SignalContext}; +use zbus::{fdo, interface, object_server::SignalEmitter}; use zbus::zvariant::{DeserializeDict, OwnedValue, SerializeDict, Type, Value}; @@ -80,7 +80,7 @@ impl SettingsBackend { #[zbus(signal)] pub async fn setting_changed( - ctxt: &SignalContext<'_>, + ctxt: &SignalEmitter<'_>, namespace: String, key: String, value: OwnedValue,