Commit 6daa80d0 authored by Nick Helm's avatar Nick Helm Committed by Stefan Kangas

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).
parent 273604dd
Pipeline #3980 failed with stage
in 65 minutes and 49 seconds
...@@ -4401,14 +4401,22 @@ in certain situations (rapid incoming events). ...@@ -4401,14 +4401,22 @@ in certain situations (rapid incoming events).
NSEvent *theEvent = [NSApp currentEvent]; NSEvent *theEvent = [NSApp currentEvent];
struct frame *emacsframe = SELECTED_FRAME (); struct frame *emacsframe = SELECTED_FRAME ();
[menu cancelTracking]; /* On macOS, the following can cause an event loop when the
menu_will_open_state = MENU_PENDING; Spotlight for Help search field is populated. Avoid this by
emacs_event->kind = MENU_BAR_ACTIVATE_EVENT; not postponing mouse drag and non-user-generated mouse down
EV_TRAILER (theEvent); events (Bug#31371). */
if (([theEvent type] == NSEventTypeLeftMouseDown)
CGEventRef ourEvent = CGEventCreate (NULL); && [theEvent eventNumber])
menu_mouse_point = CGEventGetLocation (ourEvent); {
CFRelease (ourEvent); [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) else if (menu_will_open_state == MENU_OPENING)
{ {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment