#include <X11/CoreP.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
+#ifdef USE_LUCID
#include <X11/Xaw/Paned.h>
+#endif /* USE_LUCID */
#include "../lwlib/lwlib.h"
#else /* not USE_X_TOOLKIT */
#include "../oldXMenu/XMenu.h"
}
}
\f
-/* Push all the panes and items of a menu decsribed by the
+/* Push all the panes and items of a menu described by the
alist-of-alists MENU.
This handles old-fashioned calls to x-popup-menu. */
#ifdef USE_X_TOOLKIT
/* Loop in Xt until the menu pulldown or dialog popup has been
- popped down (deactivated).
+ popped down (deactivated). This is used for x-popup-menu
+ and x-popup-dialog; it is not used for the menu bar any more.
NOTE: All calls to popup_get_selection should be protected
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
popup_activated_flag = 0;
break;
}
+ /* Button presses outside the menu also pop it down. */
+ else if (event.type == ButtonPress
+ && event.xany.display == dpyinfo->display
+ && x_any_window_to_frame (dpyinfo, event.xany.window))
+ {
+ popup_activated_flag = 0;
+ break;
+ }
/* Queue all events not for this popup,
except for Expose, which we've already handled.
if (menu_items_used == i
|| (previous_items[i] != XVECTOR (menu_items)->contents[i]))
break;
- if (i == menu_items_used && i == previous_menu_items_used)
+ if (i == menu_items_used && i == previous_menu_items_used && i != 0)
{
free_menubar_widget_value_tree (first_wv);
menu_items = Qnil;
first_wv->contents = wv;
prev_wv = wv;
}
+
+ /* Forget what we thought we knew about what is in the
+ detailed contents of the menu bar menus.
+ Changing the top level always destroys the contents. */
+ f->menu_bar_items_used = 0;
}
/* Create or update the menu bar widget. */
+ f->output_data.x->menubar_widget->core.border_width)
: 0);
+#ifdef USE_LUCID
if (FRAME_EXTERNAL_MENU_BAR (f))
{
Dimension ibw = 0;
XtNinternalBorderWidth, &ibw, NULL);
menubar_size += ibw;
}
+#endif /* USE_LUCID */
f->output_data.x->menubar_height = menubar_size;
}
UNBLOCK_INPUT;
}
-/* Called from Fx_create_frame to create the inital menubar of a frame
+/* Called from Fx_create_frame to create the initial menubar of a frame
before it is mapped, so that the window is mapped with the menubar already
there instead of us tacking it on later and thrashing the window after it
is visible. */
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
i += MENU_ITEMS_PANE_LENGTH;
}
+ /* Ignore a nil in the item list.
+ It's meaningful only for dialog boxes. */
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qquote))
+ i += 1;
else
{
entry