aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock11
-rw-r--r--Cargo.toml3
-rw-r--r--src/backend/tty.rs14
3 files changed, 12 insertions, 16 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d00655e4..05f8f6ef 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1880,16 +1880,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
-name = "logind-zbus"
-version = "3.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c07a2542f6e91ea92780158654852190edb2ba0b232d9d00d649d0c691cb7eb3"
-dependencies = [
- "serde",
- "zbus",
-]
-
-[[package]]
name = "loom"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2062,7 +2052,6 @@ dependencies = [
"keyframe",
"libc",
"log",
- "logind-zbus",
"niri-config",
"niri-ipc",
"notify-rust",
diff --git a/Cargo.toml b/Cargo.toml
index a3fcbda4..ab26019f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -54,7 +54,6 @@ input = { version = "0.9.0", features = ["libinput_1_21"] }
keyframe = { version = "1.1.1", default-features = false }
libc = "0.2.153"
log = { version = "0.4.20", features = ["max_level_trace", "release_max_level_debug"] }
-logind-zbus = { version = "3.1.2", optional = true }
niri-config = { version = "0.1.1", path = "niri-config" }
niri-ipc = { version = "0.1.1", path = "niri-ipc", features = ["clap"] }
notify-rust = { version = "4.10.0", optional = true }
@@ -99,7 +98,7 @@ proptest-derive = "0.4.0"
[features]
default = ["dbus", "xdp-gnome-screencast"]
# Enables DBus support (required for xdp-gnome and power button inhibiting).
-dbus = ["zbus", "logind-zbus", "async-channel", "async-io", "notify-rust", "url"]
+dbus = ["zbus", "async-channel", "async-io", "notify-rust", "url"]
# Enables screencasting support through xdg-desktop-portal-gnome.
xdp-gnome-screencast = ["dbus", "pipewire"]
# Enables the Tracy profiler instrumentation.
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 051376e9..4a044e4d 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -1509,9 +1509,17 @@ fn refresh_interval(mode: DrmMode) -> Duration {
#[cfg(feature = "dbus")]
fn suspend() -> anyhow::Result<()> {
let conn = zbus::blocking::Connection::system().context("error connecting to system bus")?;
- let manager = logind_zbus::manager::ManagerProxyBlocking::new(&conn)
- .context("error creating login manager proxy")?;
- manager.suspend(true).context("error suspending")
+
+ conn.call_method(
+ Some("org.freedesktop.login1"),
+ "/org/freedesktop/login1",
+ Some("org.freedesktop.login1.Manager"),
+ "Suspend",
+ &(true),
+ )
+ .context("error suspending")?;
+
+ Ok(())
}
fn queue_estimated_vblank_timer(