File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -4401,14 +4401,22 @@ in certain situations (rapid incoming events).
44014401 NSEvent *theEvent = [NSApp currentEvent ];
44024402 struct frame *emacsframe = SELECTED_FRAME ();
44034403
4404- [menu cancelTracking ];
4405- menu_will_open_state = MENU_PENDING;
4406- emacs_event->kind = MENU_BAR_ACTIVATE_EVENT;
4407- EV_TRAILER (theEvent);
4408-
4409- CGEventRef ourEvent = CGEventCreate (NULL );
4410- menu_mouse_point = CGEventGetLocation (ourEvent);
4411- CFRelease (ourEvent);
4404+ /* On macOS, the following can cause an event loop when the
4405+ Spotlight for Help search field is populated. Avoid this by
4406+ not postponing mouse drag and non-user-generated mouse down
4407+ events (Bug#31371). */
4408+ if (([theEvent type ] == NSEventTypeLeftMouseDown)
4409+ && [theEvent eventNumber ])
4410+ {
4411+ [menu cancelTracking ];
4412+ menu_will_open_state = MENU_PENDING;
4413+ emacs_event->kind = MENU_BAR_ACTIVATE_EVENT;
4414+ EV_TRAILER (theEvent);
4415+
4416+ CGEventRef ourEvent = CGEventCreate (NULL );
4417+ menu_mouse_point = CGEventGetLocation (ourEvent);
4418+ CFRelease (ourEvent);
4419+ }
44124420 }
44134421 else if (menu_will_open_state == MENU_OPENING)
44144422 {
You can’t perform that action at this time.
0 commit comments