From 71ba5024421dd475e800c55f3efce1dd887cdc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:25:08 +0200 Subject: [PATCH] chore: update zbus --- Cargo.lock | 330 +++++------------- Cargo.toml | 2 +- crates/notifier_host/src/host.rs | 4 +- crates/notifier_host/src/icon.rs | 8 +- crates/notifier_host/src/item.rs | 2 +- .../src/proxy/dbus_status_notifier_item.rs | 69 ++-- .../src/proxy/dbus_status_notifier_watcher.rs | 39 +-- crates/notifier_host/src/watcher.rs | 20 +- 8 files changed, 162 insertions(+), 312 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a723b2..35ac7f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,12 +126,14 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.5.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ - "event-listener 2.5.3", + "event-listener", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] @@ -146,80 +148,54 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - [[package]] name = "async-io" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.4.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "parking", - "polling 3.7.2", - "rustix 0.38.34", + "polling", + "rustix", "slab", "tracing", "windows-sys 0.52.0", ] -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - [[package]] name = "async-lock" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-process" -version = "1.8.1" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", + "async-channel", + "async-io", + "async-lock", "async-signal", + "async-task", "blocking", "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.34", - "windows-sys 0.48.0", + "event-listener", + "futures-lite", + "rustix", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -239,13 +215,13 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", + "async-io", + "async-lock", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.34", + "rustix", "signal-hook-registry", "slab", "windows-sys 0.52.0", @@ -378,7 +354,7 @@ dependencies = [ "async-channel", "async-task", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "piper", ] @@ -782,17 +758,6 @@ dependencies = [ "system-deps 6.2.2", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.18" @@ -870,6 +835,12 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "enumflags2" version = "0.7.10" @@ -920,23 +891,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.3.1" @@ -954,7 +908,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.1", + "event-listener", "pin-project-lite", ] @@ -980,7 +934,7 @@ dependencies = [ "libc", "log", "maplit", - "nix 0.29.0", + "nix", "notifier_host", "notify", "once_cell", @@ -1021,15 +975,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.1.0" @@ -1042,7 +987,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.1", + "memoffset", "rustc_version", ] @@ -1127,28 +1072,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ + "fastrand", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] @@ -1379,7 +1312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", @@ -1642,26 +1575,6 @@ dependencies = [ "similar", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "is-terminal" version = "0.4.12" @@ -1866,12 +1779,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1906,15 +1813,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.1" @@ -1963,18 +1861,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", -] - [[package]] name = "nix" version = "0.29.0" @@ -1985,6 +1871,7 @@ dependencies = [ "cfg-if", "cfg_aliases", "libc", + "memoffset", ] [[package]] @@ -2220,7 +2107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand", "futures-io", ] @@ -2230,22 +2117,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - [[package]] name = "polling" version = "3.7.2" @@ -2256,7 +2127,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix", "tracing", "windows-sys 0.52.0", ] @@ -2308,14 +2179,22 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_datetime", "toml_edit 0.20.2", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2501,20 +2380,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.34" @@ -2524,7 +2389,7 @@ dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -2708,16 +2573,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.7" @@ -2782,7 +2637,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote", "unicode-ident", ] @@ -2850,8 +2704,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", + "fastrand", + "rustix", "windows-sys 0.52.0", ] @@ -2917,7 +2771,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "tracing", "windows-sys 0.52.0", @@ -2961,9 +2815,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -2992,6 +2846,17 @@ dependencies = [ "winnow", ] +[[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", +] + [[package]] name = "tracing" version = "0.1.40" @@ -3035,7 +2900,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.1", + "memoffset", "tempfile", "winapi", ] @@ -3097,12 +2962,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -3441,7 +3300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "gethostname", - "rustix 0.38.34", + "rustix", "x11rb-protocol", ] @@ -3493,24 +3352,21 @@ dependencies = [ [[package]] name = "zbus" -version = "3.15.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" dependencies = [ "async-broadcast", "async-process", "async-recursion", "async-trait", - "byteorder", - "derivative", "enumflags2", - "event-listener 2.5.3", + "event-listener", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.26.4", - "once_cell", + "nix", "ordered-stream", "rand", "serde", @@ -3520,7 +3376,7 @@ dependencies = [ "tokio", "tracing", "uds_windows", - "winapi", + "windows-sys 0.52.0", "xdg-home", "zbus_macros", "zbus_names", @@ -3529,23 +3385,22 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "regex", - "syn 1.0.109", + "syn 2.0.72", "zvariant_utils", ] [[package]] name = "zbus_names" -version = "2.6.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" dependencies = [ "serde", "static_assertions", @@ -3595,13 +3450,12 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.15.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" dependencies = [ - "byteorder", + "endi", "enumflags2", - "libc", "serde", "static_assertions", "zvariant_derive", @@ -3609,24 +3463,24 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "1.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] diff --git a/Cargo.toml b/Cargo.toml index 60505e9..003ee21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ tokio-util = "0.7.11" tokio = { version = "1.39.2", features = ["full"] } unescape = "0.1" wait-timeout = "0.2" -zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } +zbus = { version = "4.4.0", default-features = false, features = ["tokio"] } [profile.dev] split-debuginfo = "unpacked" diff --git a/crates/notifier_host/src/host.rs b/crates/notifier_host/src/host.rs index b937395..723322e 100644 --- a/crates/notifier_host/src/host.rs +++ b/crates/notifier_host/src/host.rs @@ -88,7 +88,7 @@ pub async fn run_host(host: &mut dyn Host, snw: &proxy::StatusNotifierWatcherPro // initial items first for svc in try_!(snw.registered_status_notifier_items().await) { - match Item::from_address(snw.connection(), &svc).await { + match Item::from_address(snw.inner().connection(), &svc).await { Ok(item) => { item_names.insert(svc.to_owned()); host.add_item(&svc, item); @@ -110,7 +110,7 @@ pub async fn run_host(host: &mut dyn Host, snw: &proxy::StatusNotifierWatcherPro if item_names.contains(svc) { log::info!("Got duplicate new item: {:?}", svc); } else { - match Item::from_address(snw.connection(), svc).await { + match Item::from_address(snw.inner().connection(), svc).await { Ok(item) => { item_names.insert(svc.to_owned()); host.add_item(svc, item); diff --git a/crates/notifier_host/src/icon.rs b/crates/notifier_host/src/icon.rs index c903a15..ad6fdb1 100644 --- a/crates/notifier_host/src/icon.rs +++ b/crates/notifier_host/src/icon.rs @@ -136,7 +136,7 @@ pub async fn load_icon_from_sni( let icon_from_name: std::result::Result = (async { // fetch icon name let icon_name = sni.icon_name().await; - log::debug!("dbus: {} icon_name -> {:?}", sni.destination(), icon_name); + log::debug!("dbus: {} icon_name -> {:?}", sni.inner().destination(), icon_name); let icon_name = match icon_name { Ok(s) if s.is_empty() => return Err(IconError::NotAvailable), Ok(s) => s, @@ -152,7 +152,7 @@ pub async fn load_icon_from_sni( // otherwise, fetch icon theme and lookup using icon_from_name let icon_theme_path = sni.icon_theme_path().await; - log::debug!("dbus: {} icon_theme_path -> {:?}", sni.destination(), icon_theme_path); + log::debug!("dbus: {} icon_theme_path -> {:?}", sni.inner().destination(), icon_theme_path); let icon_theme_path = match icon_theme_path { Ok(p) if p.is_empty() => None, Ok(p) => Some(p), @@ -179,7 +179,7 @@ pub async fn load_icon_from_sni( match icon_from_name { Ok(p) => return Some(p), // got an icon! Err(IconError::NotAvailable) => {} // this error is expected, don't log - Err(e) => log::warn!("failed to get icon by name for {}: {}", sni.destination(), e), + Err(e) => log::warn!("failed to get icon by name for {}: {}", sni.inner().destination(), e), }; // Can't get it from name + theme, try the pixmap @@ -199,7 +199,7 @@ pub async fn load_icon_from_sni( match icon_from_pixmaps { Ok(p) => return Some(p), Err(IconError::NotAvailable) => {} - Err(e) => log::warn!("failed to get icon pixmap for {}: {}", sni.destination(), e), + Err(e) => log::warn!("failed to get icon pixmap for {}: {}", sni.inner().destination(), e), }; // Tray didn't provide a valid icon so use the default fallback one. diff --git a/crates/notifier_host/src/item.rs b/crates/notifier_host/src/item.rs index a6cb2af..ad63f34 100644 --- a/crates/notifier_host/src/item.rs +++ b/crates/notifier_host/src/item.rs @@ -82,7 +82,7 @@ impl Item { } pub async fn set_menu(&mut self, widget: >k::EventBox) -> zbus::Result<()> { - let menu = dbusmenu_gtk3::Menu::new(self.sni.destination(), &self.sni.menu().await?); + let menu = dbusmenu_gtk3::Menu::new(self.sni.inner().destination(), &self.sni.menu().await?); menu.set_attach_widget(Some(widget)); self.gtk_menu = Some(menu); Ok(()) diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs index 5c57b2a..051f180 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs @@ -1,20 +1,18 @@ -//! # DBus interface proxy for: `org.kde.StatusNotifierItem` +//! # D-Bus interface proxy for: `org.kde.StatusNotifierItem` //! -//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. -//! Source: `dbus-status-notifier-item.xml`. +//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. +//! Source: `dbus_status_notifier_item.xml`. //! //! You may prefer to adapt it, instead of using it verbatim. //! -//! More information can be found in the -//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. - -// suppress warning from generated code -#![allow(clippy::type_complexity)] - -use zbus::dbus_proxy; - -#[dbus_proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] +//! More information can be found in the [Writing a client proxy] section of the zbus +//! documentation. +//! +//! +//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html +//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, +use zbus::proxy; +#[proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] trait StatusNotifierItem { /// Activate method fn activate(&self, x: i32, y: i32) -> zbus::Result<()>; @@ -29,86 +27,87 @@ trait StatusNotifierItem { fn secondary_activate(&self, x: i32, y: i32) -> zbus::Result<()>; /// NewAttentionIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_attention_icon(&self) -> zbus::Result<()>; /// NewIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_icon(&self) -> zbus::Result<()>; /// NewOverlayIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_overlay_icon(&self) -> zbus::Result<()>; /// NewStatus signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_status(&self, status: &str) -> zbus::Result<()>; /// NewTitle signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_title(&self) -> zbus::Result<()>; /// NewToolTip signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_tool_tip(&self) -> zbus::Result<()>; /// AttentionIconName property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_icon_name(&self) -> zbus::Result; /// AttentionIconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_icon_pixmap(&self) -> zbus::Result)>>; /// AttentionMovieName property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_movie_name(&self) -> zbus::Result; /// Category property - #[dbus_proxy(property)] + #[zbus(property)] fn category(&self) -> zbus::Result; /// IconName property - #[dbus_proxy(property(emits_changed_signal = "false"))] + #[zbus(property)] fn icon_name(&self) -> zbus::Result; /// IconPixmap property - #[dbus_proxy(property(emits_changed_signal = "false"))] + #[zbus(property)] fn icon_pixmap(&self) -> zbus::Result)>>; /// IconThemePath property - #[dbus_proxy(property)] + #[zbus(property)] fn icon_theme_path(&self) -> zbus::Result; /// Id property - #[dbus_proxy(property)] + #[zbus(property)] fn id(&self) -> zbus::Result; /// ItemIsMenu property - #[dbus_proxy(property)] + #[zbus(property)] fn item_is_menu(&self) -> zbus::Result; /// Menu property - #[dbus_proxy(property)] + #[zbus(property)] fn menu(&self) -> zbus::Result; /// OverlayIconName property - #[dbus_proxy(property)] + #[zbus(property)] fn overlay_icon_name(&self) -> zbus::Result; /// OverlayIconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn overlay_icon_pixmap(&self) -> zbus::Result)>>; /// Status property - #[dbus_proxy(property)] + #[zbus(property)] fn status(&self) -> zbus::Result; /// Title property - #[dbus_proxy(property)] + #[zbus(property)] fn title(&self) -> zbus::Result; /// ToolTip property - #[dbus_proxy(property)] - fn tool_tip(&self) -> zbus::Result<(String, Vec<(i32, i32, Vec)>)>; + #[zbus(property)] + #[allow(clippy::type_complexity)] + fn tool_tip(&self) -> zbus::Result<(String, Vec<(i32, i32, Vec)>, String, String)>; } diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs index 9ac2eaa..3336baa 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs @@ -1,21 +1,18 @@ -//! # DBus interface proxy for: `org.kde.StatusNotifierWatcher` +//! # D-Bus interface proxy for: `org.kde.StatusNotifierWatcher` //! -//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. -//! Source: `dbus-status-notifier-watcher.xml`. +//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. +//! Source: `dbus_status_notifier_watcher.xml`. //! //! You may prefer to adapt it, instead of using it verbatim. //! -//! More information can be found in the -//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. - -use zbus::dbus_proxy; - -#[dbus_proxy( - default_service = "org.kde.StatusNotifierWatcher", - interface = "org.kde.StatusNotifierWatcher", - default_path = "/StatusNotifierWatcher" -)] +//! More information can be found in the [Writing a client proxy] section of the zbus +//! documentation. +//! +//! +//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html +//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, +use zbus::proxy; +#[proxy(interface = "org.kde.StatusNotifierWatcher", assume_defaults = true)] trait StatusNotifierWatcher { /// RegisterStatusNotifierHost method fn register_status_notifier_host(&self, service: &str) -> zbus::Result<()>; @@ -24,30 +21,30 @@ trait StatusNotifierWatcher { fn register_status_notifier_item(&self, service: &str) -> zbus::Result<()>; /// StatusNotifierHostRegistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_host_registered(&self) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_host_unregistered(&self) -> zbus::Result<()>; /// StatusNotifierItemRegistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_item_registered(&self, service: &str) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_item_unregistered(&self, service: &str) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[dbus_proxy(property)] + #[zbus(property)] fn is_status_notifier_host_registered(&self) -> zbus::Result; /// ProtocolVersion property - #[dbus_proxy(property)] + #[zbus(property)] fn protocol_version(&self) -> zbus::Result; /// RegisteredStatusNotifierItems property - #[dbus_proxy(property)] + #[zbus(property)] fn registered_status_notifier_items(&self) -> zbus::Result>; } diff --git a/crates/notifier_host/src/watcher.rs b/crates/notifier_host/src/watcher.rs index a0e7c13..677e378 100644 --- a/crates/notifier_host/src/watcher.rs +++ b/crates/notifier_host/src/watcher.rs @@ -1,5 +1,5 @@ use crate::names; -use zbus::{dbus_interface, export::ordered_stream::OrderedStreamExt, Interface}; +use zbus::{export::ordered_stream::OrderedStreamExt, interface, Interface}; /// An instance of [`org.kde.StatusNotifierWatcher`]. It only tracks what tray items and trays /// exist, and doesn't have any logic for displaying items (for that, see [`Host`][`crate::Host`]). @@ -23,7 +23,7 @@ pub struct Watcher { /// /// Methods and properties correspond to methods and properties on the DBus service that can be /// used by others, while signals are events that we generate that other services listen to. -#[dbus_interface(name = "org.kde.StatusNotifierWatcher")] +#[interface(name = "org.kde.StatusNotifierWatcher")] impl Watcher { /// RegisterStatusNotifierHost method async fn register_status_notifier_host( @@ -89,15 +89,15 @@ impl Watcher { } /// StatusNotifierHostRegistered signal. - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_host_registered(ctxt: &zbus::SignalContext<'_>) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_host_unregistered(ctxt: &zbus::SignalContext<'_>) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[dbus_interface(property)] + #[zbus(property)] async fn is_status_notifier_host_registered(&self) -> bool { let hosts = self.hosts.lock().unwrap(); // unwrap: mutex poisoning is okay !hosts.is_empty() @@ -159,15 +159,15 @@ impl Watcher { } /// StatusNotifierItemRegistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_item_registered(ctxt: &zbus::SignalContext<'_>, service: &str) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_item_unregistered(ctxt: &zbus::SignalContext<'_>, service: &str) -> zbus::Result<()>; /// RegisteredStatusNotifierItems property - #[dbus_interface(property)] + #[zbus(property)] async fn registered_status_notifier_items(&self) -> Vec { let items = self.items.lock().unwrap(); // unwrap: mutex poisoning is okay items.iter().cloned().collect() @@ -176,7 +176,7 @@ impl Watcher { // ------------------------------------------------------------------------ /// ProtocolVersion property - #[dbus_interface(property)] + #[zbus(property)] fn protocol_version(&self) -> i32 { 0 } @@ -244,7 +244,7 @@ async fn parse_service<'a>( ) -> zbus::fdo::Result<(zbus::names::UniqueName<'static>, &'a str)> { if service.starts_with('/') { // they sent us just the object path - if let Some(sender) = hdr.sender()? { + if let Some(sender) = hdr.sender() { Ok((sender.to_owned(), service)) } else { log::warn!("unknown sender");