vibra-pattern: End pending vibra when a new one is triggered

This wasn't much of an issue for the DBus API but when using
it as event feedback it matters as we might start the new
feedback just before the old one ended due to timers being
slighlty late.
This commit is contained in:
Guido Günther
2025-03-06 10:57:37 +01:00
parent e92df04e80
commit 54060b4e38
+3 -1
View File
@@ -192,7 +192,9 @@ fbd_feedback_vibra_pattern_start_vibra (FbdFeedbackVibra *vibra)
g_return_if_fail (self->magnitudes);
g_return_if_fail (self->durations);
g_return_if_fail (self->durations->len == self->magnitudes->len);
g_return_if_fail (self->pos == 0);
if (self->pos)
fbd_feedback_vibra_pattern_end_vibra (FBD_FEEDBACK_VIBRA (self));
g_debug ("Pattern Vibra: %u elements", self->durations->len);