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



Author: dcbw
Date: Thu Dec 11 21:40:48 2008
New Revision: 1070
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=1070&view=rev

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

	* src/applet.c
		- (applet_pre_keyring_callback): handle right-click menu too



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

Modified: trunk/src/applet.c
==============================================================================
--- trunk/src/applet.c	(original)
+++ trunk/src/applet.c	Thu Dec 11 21:40:48 2008
@@ -2328,11 +2328,10 @@
 applet_pre_keyring_callback (gpointer user_data)
 {
 	NMApplet *applet = NM_APPLET (user_data);
+	GdkScreen *screen;
+	GdkDisplay *display;
 
 	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);
@@ -2349,6 +2348,22 @@
 		gdk_display_sync (display);
 		g_object_unref (display);
 	}
+
+	if (applet->context_menu && applet->context_menu->window) {
+		screen = gdk_drawable_get_screen (applet->context_menu->window);
+		display = gdk_screen_get_display (screen);
+		g_object_ref (display);
+
+		gtk_widget_hide (applet->context_menu);
+
+		/* Ensure that the widget really gets hidden 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_hide().
+		 */
+		gdk_display_sync (display);
+		g_object_unref (display);
+	}
 }
 
 static GObject *



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