emacs-diffs
[Top][All Lists]
Advanced

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

master 6daa80d: Fix unresponsive Help menu in macOS


From: Stefan Kangas
Subject: master 6daa80d: Fix unresponsive Help menu in macOS
Date: Sat, 9 Nov 2019 05:16:49 -0500 (EST)

branch: master
commit 6daa80d04e575a27f53f60f5fafd7fcba39b4b2a
Author: Nick Helm <address@hidden>
Commit: Stefan Kangas <address@hidden>

    Fix unresponsive Help menu in macOS
    
    * src/nsterm.m (ns_check_menu_open): Don't postpone mouse drag and
    non-user-generated mouse down events (Bug#31371).
---
 src/nsterm.m | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index afe7069..9d5082b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4401,14 +4401,22 @@ ns_check_menu_open (NSMenu *menu)
           NSEvent *theEvent = [NSApp currentEvent];
           struct frame *emacsframe = SELECTED_FRAME ();
 
-          [menu cancelTracking];
-          menu_will_open_state = MENU_PENDING;
-          emacs_event->kind = MENU_BAR_ACTIVATE_EVENT;
-          EV_TRAILER (theEvent);
-
-          CGEventRef ourEvent = CGEventCreate (NULL);
-          menu_mouse_point = CGEventGetLocation (ourEvent);
-          CFRelease (ourEvent);
+          /* On macOS, the following can cause an event loop when the
+             Spotlight for Help search field is populated.  Avoid this by
+             not postponing mouse drag and non-user-generated mouse down
+             events (Bug#31371).  */
+          if (([theEvent type] == NSEventTypeLeftMouseDown)
+              && [theEvent eventNumber])
+            {
+              [menu cancelTracking];
+              menu_will_open_state = MENU_PENDING;
+              emacs_event->kind = MENU_BAR_ACTIVATE_EVENT;
+              EV_TRAILER (theEvent);
+
+              CGEventRef ourEvent = CGEventCreate (NULL);
+              menu_mouse_point = CGEventGetLocation (ourEvent);
+              CFRelease (ourEvent);
+            }
         }
       else if (menu_will_open_state == MENU_OPENING)
         {



reply via email to

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