emacs-diffs
[Top][All Lists]
Advanced

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

master 177863b: Fix crash in NS menu code


From: Alan Third
Subject: master 177863b: Fix crash in NS menu code
Date: Tue, 29 Dec 2020 08:47:19 -0500 (EST)

branch: master
commit 177863b1ce4f1ede76b1921390e50c90136af27d
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>

    Fix crash in NS menu code
    
    * src/nsmenu.m (ns_update_menubar): When the menu generation code was
    copied from xmenu.c the fix for waiting_for_input was lost.  Reinstate
    it.
---
 src/nsmenu.m | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/nsmenu.m b/src/nsmenu.m
index 2369962..201c02b 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -104,6 +104,7 @@ ns_update_menubar (struct frame *f, bool deep_p)
   NSAutoreleasePool *pool;
   BOOL needsSet = NO;
   id menu = [NSApp mainMenu];
+  bool owfi;
 
   Lisp_Object items;
   widget_value *wv, *first_wv, *prev_wv = 0;
@@ -171,6 +172,13 @@ ns_update_menubar (struct frame *f, bool deep_p)
 
       set_buffer_internal_1 (XBUFFER (buffer));
 
+      /* TODO: for some reason this is not needed in other terms, but
+        some menu updates call Info-extract-pointer which causes
+        abort-on-error if waiting-for-input.  Needs further
+        investigation.  */
+      owfi = waiting_for_input;
+      waiting_for_input = 0;
+
       /* Run the Lucid hook.  */
       safe_run_hooks (Qactivate_menubar_hook);
 
@@ -223,6 +231,7 @@ ns_update_menubar (struct frame *f, bool deep_p)
 
       submenu_start[i] = -1;
       finish_menu_items ();
+      waiting_for_input = owfi;
 
       /* Convert menu_items into widget_value trees
         to display the menu.  This cannot evaluate Lisp code.  */



reply via email to

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