summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2006-11-05 12:17:26 +0000
committerEli Zaretskii <eliz@gnu.org>2006-11-05 12:17:26 +0000
commite5d3d18d5cc97a0884839d7f15f141e2db8cc21d (patch)
treef8fa3a4e503ea2d501f0673041832ed2127d3ac0 /src
parent0ec2e29e9b11ca2959b6d338a6f548292bfe08d4 (diff)
downloademacs-e5d3d18d5cc97a0884839d7f15f141e2db8cc21d.tar.gz
(Fmenu_or_popup_active_p): New function.
(syms_of_w32menu): Defsubr it. (popup_activated_flag, popup_activated): Remove.
Diffstat (limited to 'src')
-rw-r--r--src/w32menu.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/w32menu.c b/src/w32menu.c
index 3a4dc20fc15..cf7103b727b 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -235,10 +235,6 @@ static int menu_items_n_panes;
/* Current depth within submenus. */
static int menu_items_submenu_depth;
-/* Flag which when set indicates a dialog or menu has been posted by
- Xt on behalf of one of the widget sets. */
-static int popup_activated_flag;
-
static int next_menubar_widget_id;
/* This is set nonzero after the user activates the menu bar, and set
@@ -994,6 +990,17 @@ x_activate_menubar (f)
complete_deferred_msg (FRAME_W32_WINDOW (f), WM_INITMENU, 0);
}
+/* The following is used by delayed window autoselection. */
+
+DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
+ doc: /* Return t if a menu or popup dialog is active on selected frame. */)
+ ()
+{
+ FRAME_PTR f;
+ f = SELECTED_FRAME ();
+ return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
+}
+
/* This callback is called from the menu bar pulldown menu
when the user makes a selection.
Figure out what the user chose
@@ -2148,7 +2155,6 @@ w32_dialog_show (f, keymaps, title, header, error)
/* Display the menu. */
lw_pop_up_all_widgets (dialog_id);
- popup_activated_flag = 1;
/* Process events that apply to the menu. */
popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id);
@@ -2428,13 +2434,6 @@ fill_in_menu (HMENU menu, widget_value *wv)
return 1;
}
-int
-popup_activated ()
-{
- /* popup_activated_flag not actually used on W32 */
- return 0;
-}
-
/* Display help string for currently pointed to menu item. Not
supported on NT 3.51 and earlier, as GetMenuItemInfo is not
available. */
@@ -2549,6 +2548,7 @@ void syms_of_w32menu ()
staticpro (&Qdebug_on_next_call);
defsubr (&Sx_popup_menu);
+ defsubr (&Smenu_or_popup_active_p);
#ifdef HAVE_MENUS
defsubr (&Sx_popup_dialog);
#endif