network-manager-applet r1064 - in branches/NETWORKMANAGER_APPLET_0_7: . src



Author: dcbw
Date: Tue Dec  9 16:13:37 2008
New Revision: 1064
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=1064&view=rev

Log:
2008-12-09  Dan Williams  <dcbw redhat com>

	* src/applet.c
		- (applet_pre_keyring_callback): ensure that the menu is actually
			destroyed before letting the keyring calls happen



Modified:
   branches/NETWORKMANAGER_APPLET_0_7/ChangeLog
   branches/NETWORKMANAGER_APPLET_0_7/src/applet.c

Modified: branches/NETWORKMANAGER_APPLET_0_7/src/applet.c
==============================================================================
--- branches/NETWORKMANAGER_APPLET_0_7/src/applet.c	(original)
+++ branches/NETWORKMANAGER_APPLET_0_7/src/applet.c	Tue Dec  9 16:13:37 2008
@@ -2329,10 +2329,25 @@
 {
 	NMApplet *applet = NM_APPLET (user_data);
 
-	if (applet->menu) {
+	if (applet->menu && applet->menu->window) {
+		GdkScreen *screen;
+		GdkDisplay *display;
+
+		screen = gdk_drawable_get_screen (applet->menu->window);
+		display = gdk_screen_get_display (screen);
+		g_object_ref (display);
+
 		gtk_widget_hide (applet->menu);
 		gtk_widget_destroy (applet->menu);
 		applet->menu = NULL;
+
+		/* Ensure that the widget really gets destroyed before letting the
+		 * keyring calls happen; if the X events haven't all gone through when
+		 * the keyring dialog comes up, then the menu will actually still have
+		 * the screen grab even after we've called gtk_widget_destroy().
+		 */
+		gdk_display_sync (display);
+		g_object_unref (display);
 	}
 }
 



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