aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2011-07-11 03:51:33 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2011-07-11 03:51:33 +0200
commit201ede58be208e088d123b1243ab0c485858d217 (patch)
treed241e028cd92975b4467f91d3b6e19e0adc217be
parente67e726478daa83ebb1b387a3e8464e062112d9b (diff)
downloadayatana-indicator-messages-201ede58be208e088d123b1243ab0c485858d217.tar.gz
ayatana-indicator-messages-201ede58be208e088d123b1243ab0c485858d217.tar.bz2
ayatana-indicator-messages-201ede58be208e088d123b1243ab0c485858d217.zip
Reset the un-attention icon on secondary-activate over indicator
When the messaging menu is in the "attention" state, middle-clicking over the indicator-messages will clear the attention icon.
-rw-r--r--src/indicator-messages.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index bb88c57..bee5e66 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -89,6 +89,10 @@ static void indicator_messages_dispose (GObject *object);
static void indicator_messages_finalize (GObject *object);
static GtkImage * get_icon (IndicatorObject * io);
static GtkMenu * get_menu (IndicatorObject * io);
+static void indicator_messages_middle_click (IndicatorObject * io,
+ IndicatorObjectEntry * entry,
+ guint time, gint x, gint y,
+ gpointer data);
static const gchar * get_accessible_desc (IndicatorObject * io);
static void connection_change (IndicatorServiceManager * sm,
gboolean connected,
@@ -131,6 +135,7 @@ indicator_messages_class_init (IndicatorMessagesClass *klass)
io_class->get_image = get_icon;
io_class->get_menu = get_menu;
io_class->get_accessible_desc = get_accessible_desc;
+ io_class->secondary_activate = indicator_messages_middle_click;
if (bus_node_info == NULL) {
GError * error = NULL;
@@ -755,3 +760,13 @@ get_accessible_desc (IndicatorObject * io)
{
return accessible_desc;
}
+
+/* Hide the notifications on middle-click over the indicator-messages */
+static void
+indicator_messages_middle_click (IndicatorObject * io, IndicatorObjectEntry * entry,
+ guint time, gint x, gint y, gpointer data)
+{
+ indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages");
+ accessible_desc = _("Messages");
+ update_a11y_desc();
+}