feedback-vibra: Use g_timeout_add_once

Fix some indent while at that

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther
2024-12-15 18:35:17 +01:00
parent 5ed445a81d
commit 24736b9490
+5 -5
View File
@@ -35,17 +35,17 @@ typedef struct _FbdFeedbackVibraPrivate {
G_DEFINE_TYPE_WITH_PRIVATE (FbdFeedbackVibra, fbd_feedback_vibra, FBD_TYPE_FEEDBACK_BASE);
static gboolean
static void
on_timeout_expired (FbdFeedbackVibra *self)
{
FbdFeedbackManager *manager = fbd_feedback_manager_get_default ();
FbdDevVibra *dev = fbd_feedback_manager_get_dev_vibra (manager);
fbd_dev_vibra_remove_effect (dev);
fbd_dev_vibra_stop (dev);
fbd_feedback_base_done (FBD_FEEDBACK_BASE (self));
return G_SOURCE_REMOVE;
}
static void
fbd_feedback_vibra_run (FbdFeedbackBase *base)
{
@@ -57,8 +57,8 @@ fbd_feedback_vibra_run (FbdFeedbackBase *base)
g_return_if_fail (klass->start_vibra);
klass->start_vibra (self);
priv->timer_id = g_timeout_add (priv->duration,
(GSourceFunc)on_timeout_expired,
priv->timer_id = g_timeout_add_once (priv->duration,
(GSourceOnceFunc)on_timeout_expired,
self);
g_source_set_name_by_id (priv->timer_id, "feedback-vibra-timer");
}