From ea4da08af014343bffa6254d78514c2f3076575b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 22 Nov 2019 13:19:03 +0100 Subject: [PATCH 018/181] fp-image-device: Reactivate in idle on deactivation completed This is the same logic we apply to fp-device by default: any completed action should trigger the subsequent one when it is finished. So in case we want reactivate after a deactivation, let's do it in an idle, after removing the current pending timeout. --- libfprint/fp-image-device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libfprint/fp-image-device.c b/libfprint/fp-image-device.c index 9aa9e1f..84b1bb0 100644 --- a/libfprint/fp-image-device.c +++ b/libfprint/fp-image-device.c @@ -732,7 +732,11 @@ fpi_image_device_deactivate_complete (FpImageDevice *self, GError *error) /* We might be waiting to be able to activate again. */ if (priv->pending_activation_timeout_id) - fp_image_device_activate (self); + { + g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove); + priv->pending_activation_timeout_id = + g_idle_add ((GSourceFunc) fp_image_device_activate, self); + } } /** -- 2.24.1