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.
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-22 13:19:03 +01:00
parent 60ad1ab9e3
commit ea4da08af0

View file

@ -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);
}
}
/**