aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/dbus/login1.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2022-02-01 17:38:15 +0100
committerfiaxh <git@lightrise.org>2022-02-01 23:37:54 +0100
commitb7ca33a37de5dd2ecffa7575681c6009996b7ba2 (patch)
tree838f4e36a8052cd5d287069df7b76b7fbd6fb7bd /libdino/src/dbus/login1.vala
parent1e63cb3bd935ad42af7b203efc5f4f83ae131e58 (diff)
downloaddino-b7ca33a37de5dd2ecffa7575681c6009996b7ba2.tar.gz
dino-b7ca33a37de5dd2ecffa7575681c6009996b7ba2.zip
Initialize and use dbus interfaces async
related #1155
Diffstat (limited to 'libdino/src/dbus/login1.vala')
-rw-r--r--libdino/src/dbus/login1.vala7
1 files changed, 3 insertions, 4 deletions
diff --git a/libdino/src/dbus/login1.vala b/libdino/src/dbus/login1.vala
index 904f389c..da358a99 100644
--- a/libdino/src/dbus/login1.vala
+++ b/libdino/src/dbus/login1.vala
@@ -5,14 +5,13 @@ public interface Login1Manager : Object {
public signal void PrepareForSleep(bool suspend);
}
-public static Login1Manager? get_login1() {
- Login1Manager? login1 = null;
+public static async Login1Manager? get_login1() {
try {
- login1 = Bus.get_proxy_sync(BusType.SYSTEM, "org.freedesktop.login1", "/org/freedesktop/login1");
+ return yield Bus.get_proxy(BusType.SYSTEM, "org.freedesktop.login1", "/org/freedesktop/login1");
} catch (IOError e) {
stderr.printf("%s\n", e.message);
}
- return login1;
+ return null;
}
} \ No newline at end of file