From 32839ee8f26c8f4ce0f0c306b8b4c08a5cac0478 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 30 Mar 2016 16:16:44 -0400 Subject: [PATCH] track offline/presentation mode notification ids and replace on toggle --- src/modules/notification/e_mod_main.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/modules/notification/e_mod_main.c b/src/modules/notification/e_mod_main.c index 58ecc156b..b5c8104ec 100644 --- a/src/modules/notification/e_mod_main.c +++ b/src/modules/notification/e_mod_main.c @@ -10,6 +10,9 @@ Config *notification_cfg = NULL; static E_Config_DD *conf_edd = NULL; +static unsigned int offline_id; +static unsigned int pres_id; + static unsigned int _notification_notify(E_Notification_Notify *n) { @@ -24,20 +27,28 @@ _notification_notify(E_Notification_Notify *n) return new_id; } +static void +_notification_id_update(void *d, unsigned int id) +{ + uintptr_t *update_id = d; + + *update_id = id; +} + static void _notification_show_common(const char *summary, const char *body, - int replaces_id) + unsigned int *update_id) { E_Notification_Notify n; memset(&n, 0, sizeof(E_Notification_Notify)); n.app_name = "enlightenment"; - n.replaces_id = replaces_id; + n.replaces_id = *update_id; n.icon.icon = "enlightenment"; n.summary = summary; n.body = body; n.urgency = E_NOTIFICATION_NOTIFY_URGENCY_CRITICAL; - e_notification_client_send(&n, NULL, NULL); + e_notification_client_send(&n, _notification_id_update, update_id); } static void @@ -60,7 +71,7 @@ _notification_show_presentation(Eina_Bool enabled) "power saving settings will be restored."); } - _notification_show_common(summary, body, -1); + _notification_show_common(summary, body, &pres_id); } static void @@ -83,7 +94,7 @@ _notification_show_offline(Eina_Bool enabled) "resume regular tasks."); } - _notification_show_common(summary, body, -1); + _notification_show_common(summary, body, &offline_id); } static Eina_Bool