[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 02/04: Activate the button on click

noreply at xfce.org noreply at xfce.org
Wed Feb 18 00:09:21 CET 2015


This is an automated email from the git hooks/post-receive script.

andrzejr pushed a commit to branch master
in repository panel-plugins/xfce4-pulseaudio-plugin.

commit 820460cae889550d024f7ee312b6f93b0b8bcc87
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Tue Feb 17 23:06:19 2015 +0000

    Activate the button on click
---
 panel-plugin/pulseaudio-button.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/pulseaudio-button.c b/panel-plugin/pulseaudio-button.c
index 15d940d..947fc2d 100644
--- a/panel-plugin/pulseaudio-button.c
+++ b/panel-plugin/pulseaudio-button.c
@@ -199,16 +199,15 @@ pulseaudio_button_button_press (GtkWidget      *widget,
 {
   PulseaudioButton *button = PULSEAUDIO_BUTTON (widget);
 
-  if(event->button == 1 && button->menu != NULL) /* left click only */
+  if(event->button == 1) /* left button */
     {
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),TRUE);
-      //button->deactivate_id = g_signal_connect_swapped
-      //  (G_OBJECT (button->menu), "deactivate",
-      //   G_CALLBACK (pulseaudio_button_menu_deactivate), button);
-      //gtk_menu_reposition (GTK_MENU (button->menu));
-      //gtk_menu_popup (button->menu, NULL, NULL,
-      //                xfce_panel_plugin_position_menu, button->plugin,
-      //                event->button, event->time);
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+      return TRUE;
+    }
+
+  if(event->button == 2) /* middle button */
+    {
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
       return TRUE;
     }
 
@@ -222,6 +221,8 @@ pulseaudio_button_button_release (GtkWidget      *widget,
 {
   PulseaudioButton *button = PULSEAUDIO_BUTTON (widget);
 
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+
   if (event->button == 2) /* middle button */
     {
       pulseaudio_volume_toggle_muted (button->volume);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list