[Xfce4-commits] <xfce4-indicator-plugin:master> [PATCH] Restore actions on scroll events

Mark Trompell noreply at xfce.org
Tue Oct 25 10:24:01 CEST 2011


Updating branch refs/heads/master
         to 26fec65dd0da02a599ce8771dcd285882ae013c1 (commit)
       from 49fb5c4387ebd048f2173a803a19442105447a52 (commit)

commit 26fec65dd0da02a599ce8771dcd285882ae013c1
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date:   Mon Oct 24 20:28:21 2011 +0200

    [PATCH] Restore actions on scroll events

 panel-plugin/indicator.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 594efd4..a116170 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -305,17 +305,17 @@ indicator_construct (XfcePanelPlugin *plugin)
 
 
 static gboolean
-entry_scrolled (GtkWidget *menuitem, GdkEventScroll *event, gpointer data)
+entry_scrolled (GtkWidget *menuitem, GdkEventScroll *event, IndicatorPlugin *indicator)
 {
   IndicatorObject *io = g_object_get_data (G_OBJECT (menuitem), "indicator-custom-object-data");
   IndicatorObjectEntry *entry = g_object_get_data (G_OBJECT (menuitem), "indicator-custom-entry-data");
 
   g_return_val_if_fail(INDICATOR_IS_OBJECT(io), FALSE);
+  g_return_val_if_fail(indicator != NULL, FALSE);
 
-  g_signal_emit_by_name (io, "scroll", 1, event->direction);
-  g_signal_emit_by_name (io, "scroll-entry", entry, 1, event->direction);
+  g_signal_emit_by_name (io, INDICATOR_OBJECT_SIGNAL_ENTRY_SCROLLED, entry, 1, event->direction);
 
-  return FALSE;
+  return TRUE;
 }
 
 
@@ -344,6 +344,8 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_d
 
   g_signal_connect(button, "button-press-event", G_CALLBACK(on_button_press),
                    user_data);
+  g_signal_connect(button, "scroll-event", G_CALLBACK(entry_scrolled),
+                   user_data);
   gtk_box_pack_start(GTK_BOX(((IndicatorPlugin *)user_data)->buttonbox), button, TRUE, TRUE, 0);
   gtk_widget_show(button);
   g_object_set_data(G_OBJECT(button), "indicator-custom-object-data", io);


More information about the Xfce4-commits mailing list