summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2023-01-27 15:53:27 +0100
committerBastien Nocera <hadess@hadess.net>2023-07-03 16:10:13 +0200
commitf7142fe5677790c3e5f31e05c7249d0f63b734bd (patch)
tree0b557c50b60c8b1b9129e07a2add6e4042bd3a4a
parentbabe81a8712dd1d1394d7071f564922ca00ef1c8 (diff)
daemon: Don't prepare a poll for a hidden device
We don't need to poll a device that's not registered to be visible on the bus, so check the visibility before setting that poll.
-rw-r--r--src/up-daemon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index b9f31d8..82c8b48 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -966,9 +966,6 @@ up_daemon_device_added_cb (UpBackend *backend, UpDevice *device, UpDaemon *daemo
g_signal_connect (device, "notify",
G_CALLBACK (up_daemon_device_changed_cb), daemon);
- /* Ensure we poll the new device if needed */
- g_source_set_ready_time (daemon->priv->poll_source, 0);
-
/* emit */
object_path = up_device_get_object_path (device);
if (object_path == NULL) {
@@ -977,6 +974,9 @@ up_daemon_device_added_cb (UpBackend *backend, UpDevice *device, UpDaemon *daemo
return;
}
+ /* Ensure we poll the new device if needed */
+ g_source_set_ready_time (daemon->priv->poll_source, 0);
+
g_debug ("emitting added: %s", object_path);
up_daemon_update_warning_level (daemon);
up_exported_daemon_emit_device_added (UP_EXPORTED_DAEMON (daemon), object_path);