diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-07-23 16:09:00 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-07-23 16:09:00 -0500 |
commit | bf934569374d2f15567e955c058c271d1072df7b (patch) | |
tree | bec429e798f4427afe3881fa5a1969dcbd2372c2 | |
parent | a62291be0e2ae4e16647d3cdb5c329ef61356fc7 (diff) | |
download | ayatana-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
-rw-r--r-- | src/notifier.c | 5 |
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); |