From caae9276f77ec2d8772f1ec872275e718eb15e2a Mon Sep 17 00:00:00 2001 From: Lionel Le Folgoc Date: Mon, 24 Oct 2011 20:28:21 +0200 Subject: [PATCH] Restore actions on scroll events Modules such as indicator-sound can again react to mouse scroll events, e.g. to increase/lower the volume (this feature mysteriously disappeared in 0.3.x). --- 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 1809b2c..e86b5c3 100644 --- a/panel-plugin/indicator.c +++ b/panel-plugin/indicator.c @@ -299,17 +299,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; } @@ -336,6 +336,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); -- 1.7.7