[Xfce4-commits] <xfce4-indicator-plugin:master> attach button to menu right at the beginning
Mark Trompell
noreply at xfce.org
Tue Jul 19 09:02:01 CEST 2011
Updating branch refs/heads/master
to defca954a995cba535ece42ae2a890ea0fdb3f10 (commit)
from ee9bb0bdab8fb041ad10588fbcf014877a0924b7 (commit)
commit defca954a995cba535ece42ae2a890ea0fdb3f10
Author: Mark Trompell <mark at foresightlinux.org>
Date: Tue Jul 19 09:00:00 2011 +0200
attach button to menu right at the beginning
panel-plugin/indicator.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index 4468a52..613c1a5 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -163,9 +163,7 @@ on_button_press (GtkWidget *widget, GdkEventButton *event, IndicatorPlugin *indi
{
if( event->button == 1) /* left click only */
{
- GtkMenu * menu = GTK_MENU(g_object_get_data (G_OBJECT(widget),"menu"));
- gtk_menu_attach_to_widget(menu, widget, NULL);
- gtk_menu_popup (menu, NULL, NULL,
+ gtk_menu_popup (GTK_MENU(g_object_get_data (G_OBJECT(widget),"menu")), NULL, NULL,
xfce_panel_plugin_position_menu,
indicator->plugin, 1, gtk_get_current_event_time ());
@@ -234,7 +232,10 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_d
gtk_button_set_label(GTK_BUTTON(button), gtk_label_get_label (entry->label));
if (entry->menu != NULL)
+ {
g_object_set_data(G_OBJECT(button), "menu", entry->menu);
+ gtk_menu_attach_to_widget(entry->menu, button, NULL);
+ }
g_signal_connect(button, "button-press-event", G_CALLBACK(on_button_press),
user_data);
More information about the Xfce4-commits
mailing list