emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/macmenu.c,v


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] Changes to emacs/src/macmenu.c,v
Date: Sun, 18 Mar 2007 08:06:18 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     YAMAMOTO Mitsuharu <mituharu>   07/03/18 08:06:18

Index: macmenu.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macmenu.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- macmenu.c   23 Feb 2007 08:25:58 -0000      1.55
+++ macmenu.c   18 Mar 2007 08:06:18 -0000      1.56
@@ -259,6 +259,9 @@
 /* Current depth within submenus.  */
 static int menu_items_submenu_depth;
 
+/* Nonzero means a menu is currently active.  */
+static int popup_activated_flag;
+
 /* This is set nonzero after the user activates the menu bar, and set
    to zero again after the menu bars are redisplayed by prepare_menu_bar.
    While it is nonzero, all calls to set_frame_menubar go deep.
@@ -1141,7 +1144,9 @@
   set_frame_menubar (f, 0, 1);
   BLOCK_INPUT;
 
+  popup_activated_flag = 1;
   menu_choice = MenuSelect (saved_menu_event_location);
+  popup_activated_flag = 0;
   menu_id = HiWord (menu_choice);
   menu_item = LoWord (menu_choice);
 
@@ -2237,7 +2242,9 @@
   install_menu_quit_handler (MAC_MENU_POPUP_SUB, menu);
 
   /* Display the menu.  */
+  popup_activated_flag = 1;
   menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0);
+  popup_activated_flag = 0;
 
   /* Get the refcon to find the correct item */
   if (menu_item_choice)
@@ -3218,6 +3225,14 @@
 
 #endif /* HAVE_MENUS */
 
+/* Detect if a menu is currently active.  */
+
+int
+popup_activated ()
+{
+  return popup_activated_flag;
+}
+
 /* 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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]