$NetBSD: patch-aa,v 1.8 2007/03/05 00:16:26 dbj Exp $

http://bugzilla.gnome.org/show_bug.cgi?id=382923

--- libgnomeui/gnome-ui-init.c.orig	2006-10-05 03:45:42.000000000 -0700
+++ libgnomeui/gnome-ui-init.c	2007-03-04 15:58:45.000000000 -0800
@@ -840,7 +840,17 @@ static void libgnomeui_segv_handle(int s
         /* Make sure we release grabs */
         gdk_pointer_ungrab(GDK_CURRENT_TIME);
         gdk_keyboard_ungrab(GDK_CURRENT_TIME);
-        XUngrabServer (GDK_DISPLAY ());
+#ifdef GDK_WINDOWING_X11
+	/* gdk reference counts x11 display grabs, but doesn't
+	 * provide a way to release them all.  so try several times
+	 */
+	{
+		int i;
+		for (i=0; i < 10; i++) {                
+			gdk_x11_ungrab_server();
+		}
+	}
+#endif
 
         gdk_flush();
         
