[Xfce4-commits] [apps/xfce4-notifyd] 01/01: panel-plugin: Toggle 'Do not disturb' with middle mouse click (Bug #16132)
noreply at xfce.org
noreply at xfce.org
Sat Nov 9 01:03:58 CET 2019
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-notifyd.
commit bfce8aa1108239eb58de3f588c4b3f5b75a7f91c
Author: Andre Miranda <andreldm at xfce.org>
Date: Fri Nov 8 19:45:58 2019 -0300
panel-plugin: Toggle 'Do not disturb' with middle mouse click (Bug #16132)
---
panel-plugin/notification-plugin.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/panel-plugin/notification-plugin.c b/panel-plugin/notification-plugin.c
index 0572de2..b43a33b 100644
--- a/panel-plugin/notification-plugin.c
+++ b/panel-plugin/notification-plugin.c
@@ -88,12 +88,20 @@ cb_button_pressed (GtkButton *button,
GdkEventButton *event,
NotificationPlugin *notification_plugin)
{
- if (event->button != 1)
- return FALSE;
- if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
- notification_plugin_popup_menu (notification_plugin);
-
- return TRUE;
+ if (event->button == 1 && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+ {
+ notification_plugin_popup_menu (notification_plugin);
+ return TRUE;
+ }
+
+ if (event->button == 2)
+ {
+ gboolean state = xfconf_channel_get_bool (notification_plugin->channel, "/do-not-disturb", FALSE);
+ xfconf_channel_set_bool (notification_plugin->channel, "/do-not-disturb", !state);
+ return TRUE;
+ }
+
+ return FALSE;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list