summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-06-15 16:28:39 +0200
committerBenjamin Berg <bberg@redhat.com>2022-06-15 16:29:28 +0200
commitc6cd9beff30588be711c3dd22d30f0496b210e1f (patch)
tree082cd68e9f479996f6e7800d511a0fd49de9c586
parent54e396e7ae455b57388f3b8c5a89c66b53c96f93 (diff)
downloadupower-c6cd9beff30588be711c3dd22d30f0496b210e1f.tar.gz
daemon: Iterate mainloop during coldplug
This ensures that all idle handlers have run and we report a consistent state on the bus.
-rw-r--r--src/up-daemon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index ee4149c..aa89d7d 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -534,6 +534,10 @@ up_daemon_startup (UpDaemon *daemon,
/* get battery state */
up_daemon_update_warning_level (daemon);
+
+ /* Run mainloop now to avoid state changes on DBus */
+ while (g_main_context_iteration (NULL, FALSE)) { }
+
g_debug ("daemon now not coldplug");
out: