]> code.delx.au - gnu-emacs/blobdiff - lwlib/xlwmenu.c
Merged from
[gnu-emacs] / lwlib / xlwmenu.c
index 80ca418bf525a89ed2574fc00b9cb62d0a548bd0..7b35f0ce62ac33e8b8bb185464ebe893a645a934 100644 (file)
@@ -1,6 +1,6 @@
 /* Implements a lightweight menubar widget.
    Copyright (C) 1992 Lucid, Inc.
-   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of the Lucid Widget Library.
 
@@ -1825,6 +1825,7 @@ XlwMenuRealize (w, valueMask, attributes)
   XlwMenuWidget mw = (XlwMenuWidget)w;
   XSetWindowAttributes xswa;
   int mask;
+  int count;
 
   (*xlwMenuWidgetClass->core_class.superclass->core_class.realize)
     (w, valueMask, attributes);
@@ -1832,7 +1833,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
+  count = x_catch_errors (XtDisplay (w));
+#endif
   XChangeWindowAttributes (XtDisplay (w), XtWindow (w), mask, &xswa);
+#ifdef emacs
+  x_uncatch_errors (XtDisplay (w), count);
+#endif
 
   mw->menu.windows [0].window = XtWindow (w);
   mw->menu.windows [0].x = w->core.x;
@@ -2138,6 +2148,7 @@ static widget_value *
 find_next_selectable (mw, item, skip_titles)
      XlwMenuWidget mw;
      widget_value *item;
+     int skip_titles;
 {
   widget_value *current = item;
   enum menu_separator separator;
@@ -2174,6 +2185,7 @@ static widget_value *
 find_prev_selectable (mw, item, skip_titles)
      XlwMenuWidget mw;
      widget_value *item;
+     int skip_titles;
 {
   widget_value *current = item;
   widget_value *prev = item;