emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 1458daf3164: Avoid crashes on macOS with context menus


From: Eli Zaretskii
Subject: emacs-29 1458daf3164: Avoid crashes on macOS with context menus
Date: Thu, 7 Sep 2023 01:22:29 -0400 (EDT)

branch: emacs-29
commit 1458daf316475e8c07102e4886664c4fd6790432
Author: Daniel Martín <mardani29@yahoo.es>
Commit: Eli Zaretskii <eliz@gnu.org>

    Avoid crashes on macOS with context menus
    
    * src/nsmenu.m ([EmacsMenu menuNeedsUpdate:]): Avoid crashes with
    context menus.  (Bug#63495)
---
 src/nsmenu.m | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/nsmenu.m b/src/nsmenu.m
index 2c1f575bdf2..4a86864176d 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -477,6 +477,14 @@ set_frame_menubar (struct frame *f, bool deep_p)
    call to ns_update_menubar.  */
 - (void)menuNeedsUpdate: (NSMenu *)menu
 {
+
+  /* The context menu is built and then displayed, as opposed to the
+     top-menu, which is partially built and then updated and filled in
+     when it's time to display it.  Therefore, we don't call
+     ns_update_menubar if a context menu is active. */
+  if (context_menu_value != 0)
+    return;
+
 #ifdef NS_IMPL_GNUSTEP
   static int inside = 0;
 #endif



reply via email to

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