emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: menu events get ignored when multi-line echo area message is display


From: YAMAMOTO Mitsuharu
Subject: Re: menu events get ignored when multi-line echo area message is displayed
Date: Fri, 16 Mar 2007 17:17:26 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.0.95 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Thu, 15 Mar 2007 18:22:13 +0000, David Reitter <address@hidden> said:

> A message should appear in the echo area. Then, select "Help" ->
> "Copying Conditions" (with the mouse).  Result for me is that the
> license file is NOT displayed.

> Note that it works if the message displayed has only one line.

> This is a test case of a more general bug where the first selection
> of any (?) menu item is ignored after a multi-line message has been
> displayed.  It has been reported by several Aquamacs users, but the
> above code reproduces the bug with an unpatched GNU Emacs (Carbon).

Thanks for minimizing the problematic case.  This is because
show_help_echo called from menu_target_item_handler (in macmenu.c)
indirectly calls redisplay_internal in the above case, and then
set_frame_menubar (in macmenu.c) clears f->menu_bar_items_used.

                                     YAMAMOTO Mitsuharu
                                address@hidden

*** src/xdisp.c.~1.1142.~       Sat Mar 10 10:46:41 2007
--- src/xdisp.c Fri Mar 16 17:02:48 2007
*************** redisplay_internal (preserve_echo_area)
*** 10872,10878 ****
        return;
      }
  
! #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
    if (popup_activated ())
      return;
  #endif
--- 10872,10878 ----
        return;
      }
  
! #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (MAC_OS)
    if (popup_activated ())
      return;
  #endif
*************** note_mouse_highlight (f, x, y)
*** 22672,22678 ****
    struct buffer *b;
  
    /* When a menu is active, don't highlight because this looks odd.  */
! #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
    if (popup_activated ())
      return;
  #endif
--- 22672,22678 ----
    struct buffer *b;
  
    /* When a menu is active, don't highlight because this looks odd.  */
! #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (MAC_OS)
    if (popup_activated ())
      return;
  #endif
*** src/macmenu.c.~1.55.~       Fri Feb 23 17:26:43 2007
--- src/macmenu.c       Fri Mar 16 17:03:12 2007
*************** static int menu_items_n_panes;
*** 259,264 ****
--- 259,267 ----
  /* 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.
*************** x_activate_menubar (f)
*** 1141,1147 ****
--- 1144,1152 ----
    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);
  
*************** mac_menu_show (f, x, y, for_click, keyma
*** 2237,2243 ****
--- 2242,2250 ----
    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)
*************** dispose_menus (kind, id)
*** 3218,3223 ****
--- 3225,3238 ----
  
  #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]