Commit Graph
14 Commits
Author SHA1 Message Date
Evangelos Ribeiro Tzaras 7391062b87 lfb-event: Notify state change before completing async task
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
2022-10-11 12:32:43 +02:00
Evangelos Ribeiro Tzaras 21399aec6e test-lfb-integration: Test event state in async callback 2022-10-11 12:32:26 +02:00
Evangelos Ribeiro Tzaras ad7aa5d1b0 lfb-event: Fix SPDX identifier
The library is LGPL-2.1+, not GPL-3.0+
2022-09-24 12:08:19 +02:00
Evangelos Ribeiro Tzaras bdf4403b9d spec: Clarify feedback noisiness
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.
2022-06-24 00:51:51 +02:00
Evangelos Ribeiro Tzaras b2a8061cdc doc: Clarify that the timeout is in seconds 2021-10-29 18:00:02 +02:00
Evangelos Ribeiro Tzaras 5f28638eec fbd-event: Fix return value for fbd_event_get_sender 2021-10-29 17:56:28 +02:00
Evangelos Ribeiro Tzaras ce8118e920 lfb-event: Clarify docstring on lfb_event_set_feedback_profile 2021-10-29 17:52:56 +02:00
Evangelos Ribeiro Tzaras 82a5eceec3 naming-spec: Document newly added phone-* events 2021-10-08 14:12:42 +00:00
Evangelos Ribeiro Tzaras b3d6a0d6f6 naming-spec: Fix upper cases, whitespaces and punctuation. 2021-10-08 14:12:42 +00:00
Evangelos Ribeiro Tzaras 5a439107bc feedback-theme: Add phone-outgoing-busy event
Named after the corresponding notification from the sound naming spec:
http://0pointer.de/public/sound-naming-spec.html
2021-10-08 14:12:42 +00:00
Evangelos Ribeiro Tzaras 48892de89a feedback-theme: Add phone-failure event
Named after the corresponding notification from the sound naming spec:
http://0pointer.de/public/sound-naming-spec.html
2021-10-08 14:12:42 +00:00
Evangelos Ribeiro Tzaras c783918f5b feedback-theme: Add phone-hangup event
Named after the corresponding notification from the sound naming spec:
http://0pointer.de/public/sound-naming-spec.html
2021-10-08 14:12:42 +00:00
Evangelos Ribeiro Tzaras 8e24ead69d d/control: Add json-glib-tools as build dependency
This will make sure that the json theme file gets validated in CI.
2021-10-07 18:52:11 +02:00
Evangelos Ribeiro Tzaras 1ed04e409d fbd-dev-sound: Honour sound theme name for all GNOME based desktops
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
2021-07-23 04:35:21 +02:00