summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2012-11-18 15:45:31 -0500
committerTingPing <tingping@tingping.se>2012-11-18 15:45:31 -0500
commitd67dc36bbec949e4cfe5cc0d6a837e6576b85080 (patch)
tree3f85b4e9ac151a89c455dc14ecef95aa4d499a7e /src
parent53c6fe622fecec657526e33811820c2d9e22b3cc (diff)
allow only one menu
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/plugin-tray.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c
index 136e9b8e..4380b450 100644
--- a/src/fe-gtk/plugin-tray.c
+++ b/src/fe-gtk/plugin-tray.c
@@ -499,7 +499,7 @@ tray_menu_destroy (GtkWidget *menu, gpointer userdata)
 static void
 tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
 {
-	GtkWidget *menu;
+	static GtkWidget *menu;
 #ifndef WIN32
 	GtkWidget *submenu;
 	GtkWidget *item;
@@ -509,6 +509,9 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
 	/* ph may have an invalid context now */
 	hexchat_set_context (ph, hexchat_find_context (ph, NULL, NULL));
 
+	/* close any old menu */
+	tray_menu_destroy (menu, NULL);
+
 	menu = gtk_menu_new ();
 	/*gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));*/