The carefree developer might try running meson test
before meson compile, leaving them with failing
feedback-vibra and feedback-profile tests:
Start of feedbackd tests
Start of fbd tests
Start of feedback-vibra tests
fbd-feedback-manager-DEBUG: No vibra capable device found
fbd-feedback-manager-DEBUG: Failed to init leds device: No usable LEDs found
not ok /feedbackd/fbd/feedback-vibra/pattern - GLib-GIO-FATAL-ERROR: No GSettings schemas are installed on the system
Bail out!
Signed-off-by: Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>
The carefree developer might try running meson test
before meson compile, leaving them with a failing integration test:
Start of lfb-integration tests
dbus-daemon[326641]: [session uid=1000 pid=326641 pidfd=8] Activating service name='org.sigxcpu.Feedback' requested by ':1.0' (uid=1000 pid=326640 comm="$(pwd)/_build/tests/te")
+ exec $(pwd)/_build/src/feedbackd
$(pwd)/_build/run: 18: exec: $(pwd)/_build/src/feedbackd: not found
Signed-off-by: Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>
When no feedbacks are available (either because the requested event does
not exist in the theme or because the system does not have required
capabilities, e.g. no vibration motor or LED) feedbackd will emit a
"feedback-ended" signal (with reason LFB_EVENT_STATE_REASON_NOT_FOUND)
on DBus _before_ completing the event triggering DBus call.
Since the DBus call was not completed yet, LfbEvent will not have
learned it's ID yet and therefore not emit it's own "feedback-ended"
GObject signal.
In this case the test will timeout since the main loop is never quit.
The ID is inserted into a hashtable below with GUINT_TO_POINTER
and is set using self->next_id++ with next_id also being a guint,
so change the type accordingly.
lfb_event_trigger_feedback_async() internally uses a GTask to handle
invocation of the user provided callback when g_task_return_*() is
called.
Currently GTask is completed first and only afterwards is the state of
the event being updated which can lead to suprising behaviour in code
like this:
static void
on_event_triggered (LfbEvent *event,
GAsyncResult *res,
CallsRinger *self)
{
g_autoptr (GError) err = NULL;
gboolean ok;
g_return_if_fail (LFB_IS_EVENT (event));
ok = lfb_event_trigger_feedback_finish (event, res, &err);
if (ok) {
LfbEventState state = lfb_event_get_state (event);
/* do something with state */
}
}
In this case `state` would return a stale value that's about to get
changed. Instead it would be better to *first* change the state and only
afterwards complete the GTask.
This also makes the sync and async variants consistent in terms of when
they change the event state.
Closes: #59
The old wording could be interpreted as the feedback being discarded if
it's noisier than the currently selected profile which is not the case.
Also take the new per application settings into account.
Phosh recently changed to XDG_CURRENT_DESKTOP=GNOME:Phosh and has since stopped
using the configured theme and instead used the fallback freedesktop theme.
Closes#41