network-manager-applet r626 - in trunk: . src



Author: dcbw
Date: Sun Mar 30 23:23:11 2008
New Revision: 626
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=626&view=rev

Log:
2008-03-30  Dan Williams  <dcbw redhat com>

	* src/applet.c
		- (nma_menu_create): connect to the menu's deactivate signal
		- (nma_menu_deactivate_cb): free menu items (and thus devices) when
			the menu disappears to ensure that everything gets unreffed
			properly.  Previously, since the menu items would only get unreffed
			when the menu dropped down again, devices wouldn't get disposed of
			when NetworkManager went away, and when NM would start back up again,
			the applet would have a stale AP and device list.



Modified:
   trunk/ChangeLog
   trunk/src/applet.c

Modified: trunk/src/applet.c
==============================================================================
--- trunk/src/applet.c	(original)
+++ trunk/src/applet.c	Sun Mar 30 23:23:11 2008
@@ -910,6 +910,15 @@
 //	nmi_dbus_signal_user_interface_activated (applet->connection);
 }
 
+static void
+nma_menu_deactivate_cb (GtkWidget *widget, NMApplet *applet)
+{
+	if (applet->menu) {
+		gtk_widget_destroy (applet->menu);
+		applet->menu = NULL;
+	}
+}
+
 /*
  * nma_menu_create
  *
@@ -926,6 +935,7 @@
 	menu = gtk_menu_new ();
 	gtk_container_set_border_width (GTK_CONTAINER (menu), 0);
 	g_signal_connect (menu, "show", G_CALLBACK (nma_menu_show_cb), applet);
+	g_signal_connect (menu, "deactivate", G_CALLBACK (nma_menu_deactivate_cb), applet);
 	return menu;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]