aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-messages.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indicator-messages.c')
-rw-r--r--src/indicator-messages.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index bb88c57..82a9315 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -89,7 +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 const gchar * get_accessible_desc (IndicatorObject * io);
+static void indicator_messages_middle_click (IndicatorObject * io,
+ IndicatorObjectEntry * entry,
+ guint time, gpointer data);
+static const gchar * get_accessible_desc (IndicatorObject * io);
static void connection_change (IndicatorServiceManager * sm,
gboolean connected,
gpointer user_data);
@@ -131,6 +134,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 +759,24 @@ 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, gpointer data)
+{
+ if (icon_proxy == NULL) {
+ return;
+ }
+
+ g_dbus_proxy_call(icon_proxy,
+ "ClearAttention",
+ NULL, /* params */
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, /* timeout */
+ NULL, /* cancel */
+ NULL,
+ NULL);
+
+ return;
+}