#include <X11/cursorfont.h>
#include <X11/bitmaps/gray>
#include "xlwmenuP.h"
+#ifdef emacs
+/* Defined in xterm.c. */
+extern int x_alloc_nearest_color_for_widget __P ((Widget, Colormap, XColor*));
+extern int x_catch_errors __P ((Display*));
+extern int x_uncatch_errors __P ((Display*, int));
+extern int x_had_errors_p __P ((Display*));
+extern int x_clear_errors __P ((Display*));
+#endif
static int pointer_grabbed;
static XEvent menu_post_event;
topc.green = MINL (65535, topc.green * 1.2);
topc.blue = MINL (65535, topc.blue * 1.2);
#ifdef emacs
- if (x_alloc_nearest_color_for_widget (mw, cmap, &topc))
+ if (x_alloc_nearest_color_for_widget ((Widget) mw, cmap, &topc))
#else
if (XAllocColor (dpy, cmap, &topc))
#endif
botc.green *= 0.6;
botc.blue *= 0.6;
#ifdef emacs
- if (x_alloc_nearest_color_for_widget (mw, cmap, &botc))
+ if (x_alloc_nearest_color_for_widget ((Widget) mw, cmap, &botc))
#else
if (XAllocColor (dpy, cmap, &botc))
#endif
if (!mw->menu.popped_up)
{
menu_post_event = *ev;
- pop_up_menu (mw, ev);
+ pop_up_menu (mw, (XButtonPressedEvent*) ev);
}
else
{