changeset 24060:824e346c5713

Change some menutray internals. This makes the tray-icons behave better.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 18 Sep 2008 16:19:11 +0000
parents cd35c0f680b9
children 0d0f99cd425e
files pidgin/gtkmenutray.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmenutray.c	Tue Sep 16 23:37:36 2008 +0000
+++ b/pidgin/gtkmenutray.c	Thu Sep 18 16:19:11 2008 +0000
@@ -84,6 +84,14 @@
 }
 
 static void
+pidgin_menu_tray_map(GtkWidget *widget)
+{
+	GTK_WIDGET_CLASS(parent_class)->map(widget);
+	gtk_container_add(GTK_CONTAINER(widget),
+			PIDGIN_MENU_TRAY(widget)->tray);
+}
+
+static void
 pidgin_menu_tray_finalize(GObject *obj)
 {
 	PidginMenuTray *tray = PIDGIN_MENU_TRAY(obj);
@@ -109,6 +117,7 @@
 pidgin_menu_tray_class_init(PidginMenuTrayClass *klass) {
 	GObjectClass *object_class = G_OBJECT_CLASS(klass);
 	GtkItemClass *item_class = GTK_ITEM_CLASS(klass);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 	GParamSpec *pspec;
 
 	parent_class = g_type_class_peek_parent(klass);
@@ -119,6 +128,8 @@
 	item_class->select = pidgin_menu_tray_select;
 	item_class->deselect = pidgin_menu_tray_deselect;
 
+	widget_class->map = pidgin_menu_tray_map;
+
 	pspec = g_param_spec_object("box", "The box",
 								"The box",
 								GTK_TYPE_BOX,
@@ -152,8 +163,6 @@
 		gtk_widget_set_size_request(widget, -1, height);
 	}
 
-	gtk_container_add(GTK_CONTAINER(menu_tray), menu_tray->tray);
-
 	gtk_widget_show(menu_tray->tray);
 }