/* Implements a lightweight menubar widget.
Copyright (C) 1992 Lucid, Inc.
/* Implements a lightweight menubar widget.
Copyright (C) 1992 Lucid, Inc.
-Copyright (C) 1994-1995, 1997, 1999-2011 Free Software Foundation, Inc.
+Copyright (C) 1994-1995, 1997, 1999-2012 Free Software Foundation, Inc.
so you can toggle the next one without entering the menu again. */
/* FIXME: Should ESC close one level of menu structure or the complete menu? */
so you can toggle the next one without entering the menu again. */
/* FIXME: Should ESC close one level of menu structure or the complete menu? */
{
if (mw->menu.inside_entry)
XtCallCallbackList ((Widget)mw, mw->menu.leave,
{
if (mw->menu.inside_entry)
XtCallCallbackList ((Widget)mw, mw->menu.leave,
if (old_selection || new_selection)
XtCallCallbackList ((Widget)mw, mw->menu.highlight,
(XtPointer) new_selection);
if (old_selection || new_selection)
XtCallCallbackList ((Widget)mw, mw->menu.highlight,
(XtPointer) new_selection);
XtCallCallbackList ((Widget)mw, mw->menu.leave,
(XtPointer) mw->menu.inside_entry);
mw->menu.inside_entry = NULL;
XtCallCallbackList ((Widget)mw, mw->menu.leave,
(XtPointer) mw->menu.inside_entry);
mw->menu.inside_entry = NULL;
#define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
? ((unsigned long) (x)) : ((unsigned long) (y)))
#define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
? ((unsigned long) (x)) : ((unsigned long) (y)))
{
fprintf (stderr, "Can't find font '%s'\n", fname);
mw->menu.xft_font = getDefaultXftFont (mw);
{
fprintf (stderr, "Can't find font '%s'\n", fname);
mw->menu.xft_font = getDefaultXftFont (mw);
XFreePixmap (XtDisplay (mw), mw->menu.windows [0].pixmap);
/* start from 1 because the one in slot 0 is w->core.window */
for (i = 1; i < mw->menu.windows_length; i++)
{
XFreePixmap (XtDisplay (mw), mw->menu.windows [0].pixmap);
/* start from 1 because the one in slot 0 is w->core.window */
for (i = 1; i < mw->menu.windows_length; i++)
{
XFreePixmap (XtDisplay (mw), mw->menu.windows [i].pixmap);
#ifdef HAVE_XFT
if (mw->menu.windows [i].xft_draw)
XFreePixmap (XtDisplay (mw), mw->menu.windows [i].pixmap);
#ifdef HAVE_XFT
if (mw->menu.windows [i].xft_draw)
/* Do redisplay if the contents are entirely eliminated. */
if (newmw->menu.contents
&& newmw->menu.contents->contents == 0
&& newmw->menu.contents->change >= VISIBLE_CHANGE)
/* Do redisplay if the contents are entirely eliminated. */
if (newmw->menu.contents
&& newmw->menu.contents->contents == 0
&& newmw->menu.contents->change >= VISIBLE_CHANGE)
if (newmw->core.background_pixel != oldmw->core.background_pixel
|| newmw->menu.foreground != oldmw->menu.foreground
if (newmw->core.background_pixel != oldmw->core.background_pixel
|| newmw->menu.foreground != oldmw->menu.foreground
if (XtIsRealized (current))
/* If the menu is currently displayed, change the display. */
if (XtIsRealized (current))
/* If the menu is currently displayed, change the display. */