aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2006-11-06 16:47:33 +0000
committerChong Yidong2006-11-06 16:47:33 +0000
commite3135734b208cffc5a5319714fa036b15e950a2e (patch)
tree55456019d0388eb280f73c82462d7d852585db7d /src
parentc1f043a06378a5a3f6f5dd5b7b1b383439ebc9ef (diff)
downloademacs-e3135734b208cffc5a5319714fa036b15e950a2e.tar.gz
emacs-e3135734b208cffc5a5319714fa036b15e950a2e.zip
(Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
Return nil if building without menus.
Diffstat (limited to 'src')
-rw-r--r--src/w32menu.c26
-rw-r--r--src/xmenu.c25
2 files changed, 30 insertions, 21 deletions
diff --git a/src/w32menu.c b/src/w32menu.c
index cf7103b727b..d5c38bee336 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -990,17 +990,6 @@ x_activate_menubar (f)
990 complete_deferred_msg (FRAME_W32_WINDOW (f), WM_INITMENU, 0); 990 complete_deferred_msg (FRAME_W32_WINDOW (f), WM_INITMENU, 0);
991} 991}
992 992
993/* The following is used by delayed window autoselection. */
994
995DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
996 doc: /* Return t if a menu or popup dialog is active on selected frame. */)
997 ()
998{
999 FRAME_PTR f;
1000 f = SELECTED_FRAME ();
1001 return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
1002}
1003
1004/* This callback is called from the menu bar pulldown menu 993/* This callback is called from the menu bar pulldown menu
1005 when the user makes a selection. 994 when the user makes a selection.
1006 Figure out what the user chose 995 Figure out what the user chose
@@ -2536,6 +2525,21 @@ w32_free_menu_strings (hwnd)
2536 2525
2537#endif /* HAVE_MENUS */ 2526#endif /* HAVE_MENUS */
2538 2527
2528/* The following is used by delayed window autoselection. */
2529
2530DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
2531 doc: /* Return t if a menu or popup dialog is active on selected frame. */)
2532 ()
2533{
2534#ifdef HAVE_MENUS
2535 FRAME_PTR f;
2536 f = SELECTED_FRAME ();
2537 return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
2538#else
2539 return Qnil;
2540#endif /* HAVE_MENUS */
2541}
2542
2539void syms_of_w32menu () 2543void syms_of_w32menu ()
2540{ 2544{
2541 globals_of_w32menu (); 2545 globals_of_w32menu ();
diff --git a/src/xmenu.c b/src/xmenu.c
index 397e8a59e81..24be4fd5cb7 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1414,7 +1414,7 @@ If FRAME is nil or not given, use the selected frame. */)
1414 1414
1415 gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar), 1415 gtk_menu_shell_select_item (GTK_MENU_SHELL (menubar),
1416 GTK_WIDGET (children->data)); 1416 GTK_WIDGET (children->data));
1417 1417
1418 popup_activated_flag = 1; 1418 popup_activated_flag = 1;
1419 g_list_free (children); 1419 g_list_free (children);
1420 } 1420 }
@@ -1496,15 +1496,6 @@ popup_activated ()
1496 return popup_activated_flag; 1496 return popup_activated_flag;
1497} 1497}
1498 1498
1499/* The following is used by delayed window autoselection. */
1500
1501DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
1502 doc: /* Return t if a menu or popup dialog is active. */)
1503 ()
1504{
1505 return (popup_activated ()) ? Qt : Qnil;
1506}
1507
1508/* This callback is invoked when the user selects a menubar cascade 1499/* This callback is invoked when the user selects a menubar cascade
1509 pushbutton, but before the pulldown menu is posted. */ 1500 pushbutton, but before the pulldown menu is posted. */
1510 1501
@@ -3770,6 +3761,20 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
3770#endif /* not USE_X_TOOLKIT */ 3761#endif /* not USE_X_TOOLKIT */
3771 3762
3772#endif /* HAVE_MENUS */ 3763#endif /* HAVE_MENUS */
3764
3765
3766/* The following is used by delayed window autoselection. */
3767
3768DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
3769 doc: /* Return t if a menu or popup dialog is active. */)
3770 ()
3771{
3772#ifdef HAVE_MENUS
3773 return (popup_activated ()) ? Qt : Qnil;
3774#else
3775 return Qnil;
3776#endif /* HAVE_MENUS */
3777}
3773 3778
3774void 3779void
3775syms_of_xmenu () 3780syms_of_xmenu ()