aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock206
-rw-r--r--Cargo.toml4
-rw-r--r--src/dbus/freedesktop_screensaver.rs9
-rw-r--r--src/dbus/gnome_shell_introspect.rs9
-rw-r--r--src/dbus/gnome_shell_screenshot.rs4
-rw-r--r--src/dbus/mod.rs2
-rw-r--r--src/dbus/mutter_display_config.rs9
-rw-r--r--src/dbus/mutter_screen_cast.rs31
-rw-r--r--src/dbus/mutter_service_channel.rs13
-rw-r--r--src/niri.rs8
-rw-r--r--src/pw_utils.rs4
-rw-r--r--src/utils/spawning.rs3
12 files changed, 236 insertions, 66 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 465e3daf..39c8a70b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -184,6 +184,18 @@ dependencies = [
]
[[package]]
+name = "async-broadcast"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e"
+dependencies = [
+ "event-listener 5.3.1",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
name = "async-channel"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -221,6 +233,17 @@ dependencies = [
]
[[package]]
+name = "async-fs"
+version = "2.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a"
+dependencies = [
+ "async-lock 3.4.0",
+ "blocking",
+ "futures-lite 2.3.0",
+]
+
+[[package]]
name = "async-io"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -242,9 +265,9 @@ dependencies = [
[[package]]
name = "async-io"
-version = "2.3.4"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8"
+checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059"
dependencies = [
"async-lock 3.4.0",
"cfg-if",
@@ -297,6 +320,25 @@ dependencies = [
]
[[package]]
+name = "async-process"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb"
+dependencies = [
+ "async-channel",
+ "async-io 2.4.0",
+ "async-lock 3.4.0",
+ "async-signal",
+ "async-task",
+ "blocking",
+ "cfg-if",
+ "event-listener 5.3.1",
+ "futures-lite 2.3.0",
+ "rustix 0.38.38",
+ "tracing",
+]
+
+[[package]]
name = "async-recursion"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -313,7 +355,7 @@ version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3"
dependencies = [
- "async-io 2.3.4",
+ "async-io 2.4.0",
"async-lock 3.4.0",
"atomic-waker",
"cfg-if",
@@ -817,9 +859,9 @@ dependencies = [
[[package]]
name = "cpufeatures"
-version = "0.2.14"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0"
+checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3"
dependencies = [
"libc",
]
@@ -1058,6 +1100,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
[[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"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2436,7 +2484,7 @@ dependencies = [
"approx 0.5.1",
"arrayvec",
"async-channel",
- "async-io 1.13.0",
+ "async-io 2.4.0",
"atomic",
"bitflags 2.6.0",
"bytemuck",
@@ -2482,7 +2530,7 @@ dependencies = [
"wayland-scanner",
"xcursor",
"xshell",
- "zbus",
+ "zbus 5.2.0",
]
[[package]]
@@ -2550,6 +2598,19 @@ dependencies = [
]
[[package]]
+name = "nix"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
+dependencies = [
+ "bitflags 2.6.0",
+ "cfg-if",
+ "cfg_aliases",
+ "libc",
+ "memoffset 0.9.1",
+]
+
+[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2569,7 +2630,7 @@ dependencies = [
"mac-notification-sys",
"serde",
"tauri-winrt-notification",
- "zbus",
+ "zbus 3.15.2",
]
[[package]]
@@ -4011,9 +4072,9 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.36"
+version = "0.3.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
+checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21"
dependencies = [
"deranged",
"num-conv",
@@ -5092,12 +5153,12 @@ version = "3.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6"
dependencies = [
- "async-broadcast",
+ "async-broadcast 0.5.1",
"async-executor",
- "async-fs",
+ "async-fs 1.6.0",
"async-io 1.13.0",
"async-lock 2.8.0",
- "async-process",
+ "async-process 1.8.1",
"async-recursion",
"async-task",
"async-trait",
@@ -5122,9 +5183,45 @@ dependencies = [
"uds_windows",
"winapi",
"xdg-home",
- "zbus_macros",
- "zbus_names",
- "zvariant",
+ "zbus_macros 3.15.2",
+ "zbus_names 2.6.1",
+ "zvariant 3.15.2",
+]
+
+[[package]]
+name = "zbus"
+version = "5.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb67eadba43784b6fb14857eba0d8fc518686d3ee537066eb6086dc318e2c8a1"
+dependencies = [
+ "async-broadcast 0.7.1",
+ "async-executor",
+ "async-fs 2.1.2",
+ "async-io 2.4.0",
+ "async-lock 3.4.0",
+ "async-process 2.3.0",
+ "async-recursion",
+ "async-task",
+ "async-trait",
+ "blocking",
+ "enumflags2",
+ "event-listener 5.3.1",
+ "futures-core",
+ "futures-util",
+ "hex",
+ "nix 0.29.0",
+ "ordered-stream",
+ "serde",
+ "serde_repr",
+ "static_assertions",
+ "tracing",
+ "uds_windows",
+ "windows-sys 0.59.0",
+ "winnow 0.6.20",
+ "xdg-home",
+ "zbus_macros 5.2.0",
+ "zbus_names 4.1.0",
+ "zvariant 5.1.0",
]
[[package]]
@@ -5138,7 +5235,22 @@ dependencies = [
"quote",
"regex",
"syn 1.0.109",
- "zvariant_utils",
+ "zvariant_utils 1.0.1",
+]
+
+[[package]]
+name = "zbus_macros"
+version = "5.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c9d49ebc960ceb660f2abe40a5904da975de6986f2af0d7884b39eec6528c57"
+dependencies = [
+ "proc-macro-crate 3.2.0",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.86",
+ "zbus_names 4.1.0",
+ "zvariant 5.1.0",
+ "zvariant_utils 3.0.2",
]
[[package]]
@@ -5149,7 +5261,19 @@ checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d"
dependencies = [
"serde",
"static_assertions",
- "zvariant",
+ "zvariant 3.15.2",
+]
+
+[[package]]
+name = "zbus_names"
+version = "4.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "856b7a38811f71846fd47856ceee8bccaec8399ff53fb370247e66081ace647b"
+dependencies = [
+ "serde",
+ "static_assertions",
+ "winnow 0.6.20",
+ "zvariant 5.1.0",
]
[[package]]
@@ -5227,7 +5351,22 @@ dependencies = [
"libc",
"serde",
"static_assertions",
- "zvariant_derive",
+ "zvariant_derive 3.15.2",
+]
+
+[[package]]
+name = "zvariant"
+version = "5.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1200ee6ac32f1e5a312e455a949a4794855515d34f9909f4a3e082d14e1a56f"
+dependencies = [
+ "endi",
+ "enumflags2",
+ "serde",
+ "static_assertions",
+ "winnow 0.6.20",
+ "zvariant_derive 5.1.0",
+ "zvariant_utils 3.0.2",
]
[[package]]
@@ -5240,7 +5379,20 @@ dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
- "zvariant_utils",
+ "zvariant_utils 1.0.1",
+]
+
+[[package]]
+name = "zvariant_derive"
+version = "5.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "687e3b97fae6c9104fbbd36c73d27d149abf04fb874e2efbd84838763daa8916"
+dependencies = [
+ "proc-macro-crate 3.2.0",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.86",
+ "zvariant_utils 3.0.2",
]
[[package]]
@@ -5253,3 +5405,17 @@ dependencies = [
"quote",
"syn 1.0.109",
]
+
+[[package]]
+name = "zvariant_utils"
+version = "3.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20d1d011a38f12360e5fcccceeff5e2c42a8eb7f27f0dcba97a0862ede05c9c6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "static_assertions",
+ "syn 2.0.86",
+ "winnow 0.6.20",
+]
diff --git a/Cargo.toml b/Cargo.toml
index 614e9f2e..5fa11398 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -48,7 +48,7 @@ keywords = ["wayland", "compositor", "tiling", "smithay", "wm"]
anyhow.workspace = true
arrayvec = "0.7.6"
async-channel = "2.3.1"
-async-io = { version = "1.13.0", optional = true }
+async-io = { version = "2.4.0", optional = true }
atomic = "0.6.0"
bitflags.workspace = true
bytemuck = { version = "1.19.0", features = ["derive"] }
@@ -86,7 +86,7 @@ url = { version = "2.5.3", optional = true }
wayland-backend = "0.3.7"
wayland-scanner = "0.31.5"
xcursor = "0.3.8"
-zbus = { version = "~3.15.2", optional = true }
+zbus = { version = "5.2.0", optional = true }
[dependencies.smithay]
workspace = true
diff --git a/src/dbus/freedesktop_screensaver.rs b/src/dbus/freedesktop_screensaver.rs
index 19bb6bf0..2ed874aa 100644
--- a/src/dbus/freedesktop_screensaver.rs
+++ b/src/dbus/freedesktop_screensaver.rs
@@ -6,9 +6,10 @@ use std::sync::{Arc, Mutex, OnceLock};
use anyhow::Context;
use futures_util::StreamExt;
use zbus::fdo::{self, RequestNameFlags};
+use zbus::message::Header;
use zbus::names::{OwnedUniqueName, UniqueName};
use zbus::zvariant::NoneValue;
-use zbus::{dbus_interface, MessageHeader, Task};
+use zbus::{interface, Task};
use super::Start;
@@ -20,11 +21,11 @@ pub struct ScreenSaver {
monitor_task: Arc<OnceLock<Task<()>>>,
}
-#[dbus_interface(name = "org.freedesktop.ScreenSaver")]
+#[interface(name = "org.freedesktop.ScreenSaver")]
impl ScreenSaver {
async fn inhibit(
&mut self,
- #[zbus(header)] hdr: MessageHeader<'_>,
+ #[zbus(header)] hdr: Header<'_>,
application_name: &str,
reason_for_inhibit: &str,
) -> fdo::Result<u32> {
@@ -33,7 +34,7 @@ impl ScreenSaver {
hdr.sender()
);
- let Ok(Some(name)) = hdr.sender() else {
+ let Some(name) = hdr.sender() else {
return Err(fdo::Error::Failed(String::from("no sender")));
};
let name = OwnedUniqueName::from(name.to_owned());
diff --git a/src/dbus/gnome_shell_introspect.rs b/src/dbus/gnome_shell_introspect.rs
index d9485d81..5151351b 100644
--- a/src/dbus/gnome_shell_introspect.rs
+++ b/src/dbus/gnome_shell_introspect.rs
@@ -1,8 +1,9 @@
use std::collections::HashMap;
use zbus::fdo::{self, RequestNameFlags};
+use zbus::interface;
+use zbus::object_server::SignalEmitter;
use zbus::zvariant::{SerializeDict, Type, Value};
-use zbus::{dbus_interface, SignalContext};
use super::Start;
@@ -33,7 +34,7 @@ pub struct WindowProperties {
pub app_id: String,
}
-#[dbus_interface(name = "org.gnome.Shell.Introspect")]
+#[interface(name = "org.gnome.Shell.Introspect")]
impl Introspect {
async fn get_windows(&self) -> fdo::Result<HashMap<u64, WindowProperties>> {
if let Err(err) = self.to_niri.send(IntrospectToNiri::GetWindows) {
@@ -52,8 +53,8 @@ impl Introspect {
// FIXME: call this upon window changes, once more of the infrastructure is there (will be
// needed for the event stream IPC anyway).
- #[dbus_interface(signal)]
- pub async fn windows_changed(ctxt: &SignalContext<'_>) -> zbus::Result<()>;
+ #[zbus(signal)]
+ pub async fn windows_changed(ctxt: &SignalEmitter<'_>) -> zbus::Result<()>;
}
impl Introspect {
diff --git a/src/dbus/gnome_shell_screenshot.rs b/src/dbus/gnome_shell_screenshot.rs
index 61121990..742f72b2 100644
--- a/src/dbus/gnome_shell_screenshot.rs
+++ b/src/dbus/gnome_shell_screenshot.rs
@@ -1,7 +1,7 @@
use std::path::PathBuf;
-use zbus::dbus_interface;
use zbus::fdo::{self, RequestNameFlags};
+use zbus::interface;
use super::Start;
@@ -18,7 +18,7 @@ pub enum NiriToScreenshot {
ScreenshotResult(Option<PathBuf>),
}
-#[dbus_interface(name = "org.gnome.Shell.Screenshot")]
+#[interface(name = "org.gnome.Shell.Screenshot")]
impl Screenshot {
async fn screenshot(
&self,
diff --git a/src/dbus/mod.rs b/src/dbus/mod.rs
index a231a1d1..347b16fd 100644
--- a/src/dbus/mod.rs
+++ b/src/dbus/mod.rs
@@ -1,5 +1,5 @@
use zbus::blocking::Connection;
-use zbus::Interface;
+use zbus::object_server::Interface;
use crate::niri::State;
diff --git a/src/dbus/mutter_display_config.rs b/src/dbus/mutter_display_config.rs
index b6df149c..e535e583 100644
--- a/src/dbus/mutter_display_config.rs
+++ b/src/dbus/mutter_display_config.rs
@@ -3,8 +3,9 @@ use std::sync::{Arc, Mutex};
use serde::Serialize;
use zbus::fdo::RequestNameFlags;
+use zbus::object_server::SignalEmitter;
use zbus::zvariant::{self, OwnedValue, Type};
-use zbus::{dbus_interface, fdo, SignalContext};
+use zbus::{fdo, interface};
use super::Start;
use crate::backend::IpcOutputMap;
@@ -43,7 +44,7 @@ pub struct LogicalMonitor {
properties: HashMap<String, OwnedValue>,
}
-#[dbus_interface(name = "org.gnome.Mutter.DisplayConfig")]
+#[interface(name = "org.gnome.Mutter.DisplayConfig")]
impl DisplayConfig {
async fn get_current_state(
&self,
@@ -156,8 +157,8 @@ impl DisplayConfig {
Ok((0, monitors, logical_monitors, properties))
}
- #[dbus_interface(signal)]
- pub async fn monitors_changed(ctxt: &SignalContext<'_>) -> zbus::Result<()>;
+ #[zbus(signal)]
+ pub async fn monitors_changed(ctxt: &SignalEmitter<'_>) -> zbus::Result<()>;
}
impl DisplayConfig {
diff --git a/src/dbus/mutter_screen_cast.rs b/src/dbus/mutter_screen_cast.rs
index 0aba084e..a19535ae 100644
--- a/src/dbus/mutter_screen_cast.rs
+++ b/src/dbus/mutter_screen_cast.rs
@@ -5,8 +5,9 @@ use std::sync::{Arc, Mutex};
use serde::Deserialize;
use zbus::fdo::RequestNameFlags;
+use zbus::object_server::{InterfaceRef, SignalEmitter};
use zbus::zvariant::{DeserializeDict, OwnedObjectPath, SerializeDict, Type, Value};
-use zbus::{dbus_interface, fdo, InterfaceRef, ObjectServer, SignalContext};
+use zbus::{fdo, interface, ObjectServer};
use super::Start;
use crate::backend::IpcOutputMap;
@@ -94,14 +95,14 @@ pub enum ScreenCastToNiri {
session_id: usize,
target: StreamTargetId,
cursor_mode: CursorMode,
- signal_ctx: SignalContext<'static>,
+ signal_ctx: SignalEmitter<'static>,
},
StopCast {
session_id: usize,
},
}
-#[dbus_interface(name = "org.gnome.Mutter.ScreenCast")]
+#[interface(name = "org.gnome.Mutter.ScreenCast")]
impl ScreenCast {
async fn create_session(
&self,
@@ -136,26 +137,26 @@ impl ScreenCast {
Ok(path)
}
- #[dbus_interface(property)]
+ #[zbus(property)]
async fn version(&self) -> i32 {
4
}
}
-#[dbus_interface(name = "org.gnome.Mutter.ScreenCast.Session")]
+#[interface(name = "org.gnome.Mutter.ScreenCast.Session")]
impl Session {
async fn start(&self) {
debug!("start");
for (stream, iface) in &*self.streams.lock().unwrap() {
- stream.start(self.id, iface.signal_context().clone());
+ stream.start(self.id, iface.signal_emitter().clone());
}
}
pub async fn stop(
&self,
#[zbus(object_server)] server: &ObjectServer,
- #[zbus(signal_context)] ctxt: SignalContext<'_>,
+ #[zbus(signal_context)] ctxt: SignalEmitter<'_>,
) {
debug!("stop");
@@ -175,7 +176,7 @@ impl Session {
let streams = mem::take(&mut *self.streams.lock().unwrap());
for (_, iface) in streams.iter() {
server
- .remove::<Stream, _>(iface.signal_context().path())
+ .remove::<Stream, _>(iface.signal_emitter().path())
.await
.unwrap();
}
@@ -264,17 +265,17 @@ impl Session {
Ok(path)
}
- #[dbus_interface(signal)]
- async fn closed(ctxt: &SignalContext<'_>) -> zbus::Result<()>;
+ #[zbus(signal)]
+ async fn closed(ctxt: &SignalEmitter<'_>) -> zbus::Result<()>;
}
-#[dbus_interface(name = "org.gnome.Mutter.ScreenCast.Stream")]
+#[interface(name = "org.gnome.Mutter.ScreenCast.Stream")]
impl Stream {
- #[dbus_interface(signal)]
- pub async fn pipe_wire_stream_added(ctxt: &SignalContext<'_>, node_id: u32)
+ #[zbus(signal)]
+ pub async fn pipe_wire_stream_added(ctxt: &SignalEmitter<'_>, node_id: u32)
-> zbus::Result<()>;
- #[dbus_interface(property)]
+ #[zbus(property)]
async fn parameters(&self) -> StreamParameters {
match &self.target {
StreamTarget::Output(output) => {
@@ -361,7 +362,7 @@ impl Stream {
}
}
- fn start(&self, session_id: usize, ctxt: SignalContext<'static>) {
+ fn start(&self, session_id: usize, ctxt: SignalEmitter<'static>) {
if self.was_started.load(Ordering::SeqCst) {
return;
}
diff --git a/src/dbus/mutter_service_channel.rs b/src/dbus/mutter_service_channel.rs
index c78dcbee..d2be1c5f 100644
--- a/src/dbus/mutter_service_channel.rs
+++ b/src/dbus/mutter_service_channel.rs
@@ -1,9 +1,8 @@
-use std::os::fd::{FromRawFd, IntoRawFd};
use std::os::unix::net::UnixStream;
use std::sync::Arc;
use smithay::reexports::wayland_server::DisplayHandle;
-use zbus::dbus_interface;
+use zbus::{fdo, interface, zvariant};
use super::Start;
use crate::niri::ClientState;
@@ -12,14 +11,14 @@ pub struct ServiceChannel {
display: DisplayHandle,
}
-#[dbus_interface(name = "org.gnome.Mutter.ServiceChannel")]
+#[interface(name = "org.gnome.Mutter.ServiceChannel")]
impl ServiceChannel {
async fn open_wayland_service_connection(
&mut self,
service_client_type: u32,
- ) -> zbus::fdo::Result<zbus::zvariant::OwnedFd> {
+ ) -> fdo::Result<zvariant::OwnedFd> {
if service_client_type != 1 {
- return Err(zbus::fdo::Error::InvalidArgs(
+ return Err(fdo::Error::InvalidArgs(
"Invalid service client type".to_owned(),
));
}
@@ -34,7 +33,7 @@ impl ServiceChannel {
credentials_unknown: true,
});
self.display.insert_client(sock2, data).unwrap();
- Ok(unsafe { zbus::zvariant::OwnedFd::from_raw_fd(sock1.into_raw_fd()) })
+ Ok(zvariant::OwnedFd::from(std::os::fd::OwnedFd::from(sock1)))
}
}
@@ -46,7 +45,7 @@ impl ServiceChannel {
impl Start for ServiceChannel {
fn start(self) -> anyhow::Result<zbus::blocking::Connection> {
- let conn = zbus::blocking::ConnectionBuilder::session()?
+ let conn = zbus::blocking::connection::Builder::session()?
.name("org.gnome.Mutter.ServiceChannel")?
.serve_at("/org/gnome/Mutter/ServiceChannel", self)?
.build()?;
diff --git a/src/niri.rs b/src/niri.rs
index 1dfd44a9..a0819732 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -2067,7 +2067,7 @@ impl Niri {
use smithay::reexports::rustix::io::{fcntl_setfd, FdFlags};
- let conn = zbus::blocking::ConnectionBuilder::system()?.build()?;
+ let conn = zbus::blocking::Connection::system()?;
let message = conn.call_method(
Some("org.freedesktop.login1"),
@@ -2077,7 +2077,7 @@ impl Niri {
&("handle-power-key", "niri", "Power key handling", "block"),
)?;
- let fd: zbus::zvariant::OwnedFd = message.body()?;
+ let fd: zbus::zvariant::OwnedFd = message.body().deserialize()?;
// Don't leak the fd to child processes.
let borrowed = unsafe { BorrowedFd::borrow_raw(fd.as_raw_fd()) };
@@ -4294,7 +4294,7 @@ impl Niri {
async_io::block_on(async move {
iface
.get()
- .stop(&server, iface.signal_context().clone())
+ .stop(server.inner(), iface.signal_emitter().clone())
.await
});
}
@@ -4774,7 +4774,7 @@ impl Niri {
};
async_io::block_on(async move {
- if let Err(err) = DisplayConfig::monitors_changed(iface.signal_context()).await
+ if let Err(err) = DisplayConfig::monitors_changed(iface.signal_emitter()).await
{
warn!("error emitting MonitorsChanged: {err:?}");
}
diff --git a/src/pw_utils.rs b/src/pw_utils.rs
index 95b7e9c0..6712eeb3 100644
--- a/src/pw_utils.rs
+++ b/src/pw_utils.rs
@@ -41,7 +41,7 @@ use smithay::reexports::calloop::generic::Generic;
use smithay::reexports::calloop::{Interest, LoopHandle, Mode, PostAction};
use smithay::reexports::gbm::Modifier;
use smithay::utils::{Physical, Scale, Size, Transform};
-use zbus::SignalContext;
+use zbus::object_server::SignalEmitter;
use crate::dbus::mutter_screen_cast::{self, CursorMode};
use crate::niri::State;
@@ -188,7 +188,7 @@ impl PipeWire {
refresh: u32,
alpha: bool,
cursor_mode: CursorMode,
- signal_ctx: SignalContext<'static>,
+ signal_ctx: SignalEmitter<'static>,
) -> anyhow::Result<Cast> {
let _span = tracy_client::span!("PipeWire::start_cast");
diff --git a/src/utils/spawning.rs b/src/utils/spawning.rs
index b7aa0d44..38ac52e6 100644
--- a/src/utils/spawning.rs
+++ b/src/utils/spawning.rs
@@ -424,8 +424,9 @@ mod systemd {
trace!("waiting for JobRemoved");
for message in signals {
+ let body = message.body();
let body: (u32, OwnedObjectPath, &str, &str) =
- message.body().context("error parsing signal")?;
+ body.deserialize().context("error parsing signal")?;
if body.1 == job {
// Our transient unit had started, we're good to exit the intermediate child.