aboutsummaryrefslogtreecommitdiffstats
path: root/src/macmenu.c
diff options
context:
space:
mode:
authorKaroly Lorentey2007-04-22 12:12:29 +0000
committerKaroly Lorentey2007-04-22 12:12:29 +0000
commite18c709364b095ea0be8ecabe458ac9a642a252f (patch)
treeefe814a842f932f387b3947c572bf43a548d17ef /src/macmenu.c
parent81088e260b086fe28f36964f32b6338210ec6fd8 (diff)
parent9f25e707aaad5ed14a9448e9c5d345ff0bdbc5a7 (diff)
downloademacs-e18c709364b095ea0be8ecabe458ac9a642a252f.tar.gz
emacs-e18c709364b095ea0be8ecabe458ac9a642a252f.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-660 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-661 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-662 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-663 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-664 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-665 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-666 Fix read-only prompt problem in isearch * emacs@sv.gnu.org/emacs--devo--0--patch-667 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-668 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-669 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-670 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-671 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-672 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-673 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-206 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-207 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-208 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-600
Diffstat (limited to 'src/macmenu.c')
-rw-r--r--src/macmenu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/macmenu.c b/src/macmenu.c
index 82322515c31..c7a84df7106 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -259,6 +259,9 @@ static int menu_items_n_panes;
259/* Current depth within submenus. */ 259/* Current depth within submenus. */
260static int menu_items_submenu_depth; 260static int menu_items_submenu_depth;
261 261
262/* Nonzero means a menu is currently active. */
263static int popup_activated_flag;
264
262/* This is set nonzero after the user activates the menu bar, and set 265/* This is set nonzero after the user activates the menu bar, and set
263 to zero again after the menu bars are redisplayed by prepare_menu_bar. 266 to zero again after the menu bars are redisplayed by prepare_menu_bar.
264 While it is nonzero, all calls to set_frame_menubar go deep. 267 While it is nonzero, all calls to set_frame_menubar go deep.
@@ -1141,7 +1144,9 @@ x_activate_menubar (f)
1141 set_frame_menubar (f, 0, 1); 1144 set_frame_menubar (f, 0, 1);
1142 BLOCK_INPUT; 1145 BLOCK_INPUT;
1143 1146
1147 popup_activated_flag = 1;
1144 menu_choice = MenuSelect (saved_menu_event_location); 1148 menu_choice = MenuSelect (saved_menu_event_location);
1149 popup_activated_flag = 0;
1145 menu_id = HiWord (menu_choice); 1150 menu_id = HiWord (menu_choice);
1146 menu_item = LoWord (menu_choice); 1151 menu_item = LoWord (menu_choice);
1147 1152
@@ -2237,7 +2242,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
2237 install_menu_quit_handler (MAC_MENU_POPUP_SUB, menu); 2242 install_menu_quit_handler (MAC_MENU_POPUP_SUB, menu);
2238 2243
2239 /* Display the menu. */ 2244 /* Display the menu. */
2245 popup_activated_flag = 1;
2240 menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0); 2246 menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0);
2247 popup_activated_flag = 0;
2241 2248
2242 /* Get the refcon to find the correct item */ 2249 /* Get the refcon to find the correct item */
2243 if (menu_item_choice) 2250 if (menu_item_choice)
@@ -3218,6 +3225,14 @@ dispose_menus (kind, id)
3218 3225
3219#endif /* HAVE_MENUS */ 3226#endif /* HAVE_MENUS */
3220 3227
3228/* Detect if a menu is currently active. */
3229
3230int
3231popup_activated ()
3232{
3233 return popup_activated_flag;
3234}
3235
3221/* The following is used by delayed window autoselection. */ 3236/* The following is used by delayed window autoselection. */
3222 3237
3223DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, 3238DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,