Cosmetic changes to lib-src/Makefile.in.
[bpt/emacs.git] / lwlib / xlwmenu.c
index 2320dbc..2ae7ae5 100644 (file)
@@ -1,7 +1,7 @@
 /* Implements a lightweight menubar widget.
 Copyright (C) 1992 Lucid, Inc.
 Copyright (C) 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-  2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+  2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA.  */
 #include <config.h>
 #endif
 
+#include <setjmp.h>
 #include "lisp.h"
 
 #include <stdio.h>
@@ -1844,7 +1845,16 @@ XlwMenuRealize (w, valueMask, attributes)
   xswa.save_under = True;
   xswa.cursor = mw->menu.cursor_shape;
   mask = CWSaveUnder | CWCursor;
+  /* I sometimes get random BadCursor errors while creating the first
+     frame on a display.  I can not find their reason, but they are
+     annoying so for now let's ignore any errors here.  -- lorentey  */
+#ifdef emacs
+  x_catch_errors (XtDisplay (w));
+#endif
   XChangeWindowAttributes (XtDisplay (w), XtWindow (w), mask, &xswa);
+#ifdef emacs
+  x_uncatch_errors ();
+#endif
 
   mw->menu.windows [0].window = XtWindow (w);
   mw->menu.windows [0].x = w->core.x;