diff -Nru indicator-notifications-0.3.2/configure indicator-notifications-0.3.3/configure --- indicator-notifications-0.3.2/configure 2016-08-29 18:48:53.000000000 +0000 +++ indicator-notifications-0.3.3/configure 2017-03-15 19:00:37.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for indicator-notifications 0.3.2. +# Generated by GNU Autoconf 2.69 for indicator-notifications 0.3.3. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='indicator-notifications' PACKAGE_TARNAME='indicator-notifications' -PACKAGE_VERSION='0.3.2' -PACKAGE_STRING='indicator-notifications 0.3.2' +PACKAGE_VERSION='0.3.3' +PACKAGE_STRING='indicator-notifications 0.3.3' PACKAGE_BUGREPORT='jason.conti@gmail.com' PACKAGE_URL='' @@ -1365,7 +1365,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures indicator-notifications 0.3.2 to adapt to many kinds of systems. +\`configure' configures indicator-notifications 0.3.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1436,7 +1436,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-notifications 0.3.2:";; + short | recursive ) echo "Configuration of indicator-notifications 0.3.3:";; esac cat <<\_ACEOF @@ -1555,7 +1555,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-notifications configure 0.3.2 +indicator-notifications configure 0.3.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by indicator-notifications $as_me 0.3.2, which was +It was created by indicator-notifications $as_me 0.3.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2697,7 +2697,7 @@ # Define the identity of the package. PACKAGE='indicator-notifications' - VERSION='0.3.2' + VERSION='0.3.3' cat >>confdefs.h <<_ACEOF @@ -13919,7 +13919,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by indicator-notifications $as_me 0.3.2, which was +This file was extended by indicator-notifications $as_me 0.3.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13985,7 +13985,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -indicator-notifications config.status 0.3.2 +indicator-notifications config.status 0.3.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru indicator-notifications-0.3.2/configure.ac indicator-notifications-0.3.3/configure.ac --- indicator-notifications-0.3.2/configure.ac 2016-08-29 18:45:57.000000000 +0000 +++ indicator-notifications-0.3.3/configure.ac 2017-03-15 17:06:22.000000000 +0000 @@ -1,4 +1,4 @@ -AC_INIT([indicator-notifications], [0.3.2], [jason.conti@gmail.com]) +AC_INIT([indicator-notifications], [0.3.3], [jason.conti@gmail.com]) AM_INIT_AUTOMAKE([-Wall -Werror]) diff -Nru indicator-notifications-0.3.2/data/net.launchpad.indicator.notifications.gschema.xml.in.in indicator-notifications-0.3.3/data/net.launchpad.indicator.notifications.gschema.xml.in.in --- indicator-notifications-0.3.2/data/net.launchpad.indicator.notifications.gschema.xml.in.in 2014-01-15 20:07:37.000000000 +0000 +++ indicator-notifications-0.3.3/data/net.launchpad.indicator.notifications.gschema.xml.in.in 2017-03-15 17:05:48.000000000 +0000 @@ -5,6 +5,11 @@ <_summary>Discard notifications by application name <_description>If an application name is in the blacklist, all notifications matching the application name will be discarded. + + false + <_summary>Clear notifications on middle click + <_description>Normally when middle clicking the notification icon, the unread status will be toggled if the queue is not empty. With this option enabled, the notification queue will be cleared instead. + false <_summary>Hide the indicator diff -Nru indicator-notifications-0.3.2/debian/changelog indicator-notifications-0.3.3/debian/changelog --- indicator-notifications-0.3.2/debian/changelog 2016-08-30 18:33:08.000000000 +0000 +++ indicator-notifications-0.3.3/debian/changelog 2017-03-15 19:44:38.000000000 +0000 @@ -1,4 +1,11 @@ -indicator-notifications (0.3.2-0~ppa~xenial) xenial; urgency=medium +indicator-notifications (0.3.3-0~ppa~xenial) xenial; urgency=medium + + * New upstream release. + - Add an option to clear notifications on icon middle click. + + -- Jason Conti Wed, 15 Mar 2017 13:56:32 -0400 + +indicator-notifications (0.3.2-0~ppa~trusty) trusty; urgency=medium * New upstream release. - Make sure to escape the urls. diff -Nru indicator-notifications-0.3.2/src/indicator-notifications.c indicator-notifications-0.3.3/src/indicator-notifications.c --- indicator-notifications-0.3.2/src/indicator-notifications.c 2016-08-29 17:14:37.000000000 +0000 +++ indicator-notifications-0.3.3/src/indicator-notifications.c 2017-03-15 18:53:25.000000000 +0000 @@ -65,6 +65,7 @@ GList *visible_items; GList *hidden_items; + gboolean clear_on_middle_click; gboolean have_unread; gboolean hide_indicator; @@ -88,6 +89,7 @@ #define NOTIFICATIONS_SCHEMA "net.launchpad.indicator.notifications" #define NOTIFICATIONS_KEY_BLACKLIST "blacklist" +#define NOTIFICATIONS_KEY_CLEAR_MC "clear-on-middle-click" #define NOTIFICATIONS_KEY_HIDE_INDICATOR "hide-indicator" #define NOTIFICATIONS_KEY_MAX_ITEMS "max-items" @@ -196,6 +198,7 @@ /* Connect to GSettings */ self->priv->settings = g_settings_new(NOTIFICATIONS_SCHEMA); + self->priv->clear_on_middle_click = g_settings_get_boolean(self->priv->settings, NOTIFICATIONS_KEY_CLEAR_MC); self->priv->hide_indicator = g_settings_get_boolean(self->priv->settings, NOTIFICATIONS_KEY_HIDE_INDICATOR); self->priv->max_items = g_settings_get_int(self->priv->settings, NOTIFICATIONS_KEY_MAX_ITEMS); update_blacklist(self); @@ -289,8 +292,16 @@ { IndicatorNotifications *self = INDICATOR_NOTIFICATIONS(io); - if(g_list_length(self->priv->visible_items) > 0) - set_unread(self, !self->priv->have_unread); + /* Clear the notifications */ + if(self->priv->clear_on_middle_click) { + clear_menuitems(self); + set_unread(self, FALSE); + } + /* Otherwise toggle unread status */ + else { + if(g_list_length(self->priv->visible_items) > 0) + set_unread(self, !self->priv->have_unread); + } } /** @@ -524,6 +535,9 @@ self->priv->hide_indicator = g_settings_get_boolean(settings, NOTIFICATIONS_KEY_HIDE_INDICATOR); update_indicator_visibility(self); } + else if(g_strcmp0(key, NOTIFICATIONS_KEY_CLEAR_MC) == 0) { + self->priv->clear_on_middle_click = g_settings_get_boolean(self->priv->settings, NOTIFICATIONS_KEY_CLEAR_MC); + } else if(g_strcmp0(key, NOTIFICATIONS_KEY_BLACKLIST) == 0) { update_blacklist(self); }