aboutsummaryrefslogtreecommitdiff
path: root/src/notifier.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-23 16:09:00 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-23 16:09:00 -0500
commitbf934569374d2f15567e955c058c271d1072df7b (patch)
treebec429e798f4427afe3881fa5a1969dcbd2372c2 /src/notifier.c
parenta62291be0e2ae4e16647d3cdb5c329ef61356fc7 (diff)
downloadayatana-indicator-power-bf934569374d2f15567e955c058c271d1072df7b.tar.gz
ayatana-indicator-power-bf934569374d2f15567e955c058c271d1072df7b.tar.bz2
ayatana-indicator-power-bf934569374d2f15567e955c058c271d1072df7b.zip
make the notifications click-to-dismiss by adding the 'interactive notification' hint
Diffstat (limited to 'src/notifier.c')
-rw-r--r--src/notifier.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/notifier.c b/src/notifier.c
index 364628c..8c12dfc 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -26,6 +26,8 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
+#define HINT_INTERACTIVE "x-canonical-switch-to-application"
+
G_DEFINE_TYPE(IndicatorPowerNotifier,
indicator_power_notifier,
G_TYPE_OBJECT)
@@ -114,6 +116,9 @@ notification_show(IndicatorPowerNotifier * self)
body = g_strdup_printf(_("%.0f%% charge remaining"),
indicator_power_device_get_percentage(p->battery));
p->notify_notification = notify_notification_new(_("Battery Low"), body, NULL);
+ notify_notification_set_hint(p->notify_notification,
+ HINT_INTERACTIVE,
+ g_variant_new_boolean(TRUE));
g_signal_connect_swapped(p->notify_notification, "closed",
G_CALLBACK(notification_clear), self);