diff options
| author | Nick Helm | 2019-10-14 14:11:25 +1300 |
|---|---|---|
| committer | Stefan Kangas | 2019-11-09 10:57:59 +0100 |
| commit | 6daa80d04e575a27f53f60f5fafd7fcba39b4b2a (patch) | |
| tree | 00faba0f11d153ef96c43b9eed4644d6f354ee27 | |
| parent | 273604dd87f1955f2090650d2699b4ebfb322db8 (diff) | |
| download | emacs-6daa80d04e575a27f53f60f5fafd7fcba39b4b2a.tar.gz emacs-6daa80d04e575a27f53f60f5fafd7fcba39b4b2a.zip | |
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).
| -rw-r--r-- | src/nsterm.m | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index afe7069aaed..9d5082b71df 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -4401,14 +4401,22 @@ ns_check_menu_open (NSMenu *menu) | |||
| 4401 | NSEvent *theEvent = [NSApp currentEvent]; | 4401 | NSEvent *theEvent = [NSApp currentEvent]; |
| 4402 | struct frame *emacsframe = SELECTED_FRAME (); | 4402 | struct frame *emacsframe = SELECTED_FRAME (); |
| 4403 | 4403 | ||
| 4404 | [menu cancelTracking]; | 4404 | /* On macOS, the following can cause an event loop when the |
| 4405 | menu_will_open_state = MENU_PENDING; | 4405 | Spotlight for Help search field is populated. Avoid this by |
| 4406 | emacs_event->kind = MENU_BAR_ACTIVATE_EVENT; | 4406 | not postponing mouse drag and non-user-generated mouse down |
| 4407 | EV_TRAILER (theEvent); | 4407 | events (Bug#31371). */ |
| 4408 | 4408 | if (([theEvent type] == NSEventTypeLeftMouseDown) | |
| 4409 | CGEventRef ourEvent = CGEventCreate (NULL); | 4409 | && [theEvent eventNumber]) |
| 4410 | menu_mouse_point = CGEventGetLocation (ourEvent); | 4410 | { |
| 4411 | CFRelease (ourEvent); | 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 | } | ||
| 4412 | } | 4420 | } |
| 4413 | else if (menu_will_open_state == MENU_OPENING) | 4421 | else if (menu_will_open_state == MENU_OPENING) |
| 4414 | { | 4422 | { |