From: Nick <nick@tenpoint.co.nz>
To: Stefan Kangas <stefan@marxist.se>
Cc: Robert Pluim <rpluim@gmail.com>,
31371@debbugs.gnu.org, Alan Third <alan@idiocy.org>
Subject: bug#31371: 26.1; Menu-bar stops working after search
Date: Mon, 14 Oct 2019 14:50:04 +1300 [thread overview]
Message-ID: <m236fwrt83.fsf@tenpoint.co.nz> (raw)
In-Reply-To: <CADwFkm=BSM76cBjrc1YZ+Kf+G2JTi=W-m3NtmynfJ7b0QqytNg@mail.gmail.com> (Stefan Kangas's message of "Fri, 11 Oct 2019 13:25:06 +0200")
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
Stefan Kangas <stefan@marxist.se> writes:
> I've tried your patch on macOS 10.13, and it fixes the issues with the
> help menu for me. The code looks okay to me, but I don't know much
> about Objective-C or macOS development, so it would be good if someone
> else could review it too.
>
> Nick, could you please provide a ChangeLog entry for these changes and
> send them using "git format-patch -1"? Details on how to do that well
> are in the CONTRIBUTE file. Thanks in advance.
Thanks for testing. Updated patch attached.
Nick
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-unresponsive-Help-menu-in-macOS.patch --]
[-- Type: text/x-patch, Size: 1878 bytes --]
From 9ec201c229fdb8f9fbed1050961730daaf9db718 Mon Sep 17 00:00:00 2001
From: Nick Helm <nick@tenpoint.co.nz>
Date: Mon, 14 Oct 2019 14:11:25 +1300
Subject: [PATCH] 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 bbd2c84..cc21ec3 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4292,14 +4292,22 @@ in certain situations (rapid incoming events).
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)
{
--
2.20.1 (Apple Git-117)
next prev parent reply other threads:[~2019-10-14 1:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-05 14:15 bug#31371: 26.1; Menu-bar stops working after search Nick Helm
2018-05-06 10:14 ` Alan Third
2018-05-07 2:48 ` Nick Helm
2018-05-08 5:24 ` Nick Helm
2018-05-08 21:40 ` Alan Third
2018-05-13 10:09 ` Nick Helm
2018-05-18 21:33 ` George Plymale II
2018-05-19 4:26 ` Nick Helm
2019-10-11 11:25 ` Stefan Kangas
2019-10-11 12:04 ` Robert Pluim
2019-10-14 1:50 ` Nick [this message]
2019-10-14 12:44 ` Stefan Kangas
2019-10-14 12:55 ` Robert Pluim
2019-10-14 13:14 ` Alan Third
2019-11-05 15:13 ` Stefan Kangas
2019-11-09 10:18 ` Stefan Kangas
2019-11-09 11:29 ` Alan Third
2019-12-31 10:29 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m236fwrt83.fsf@tenpoint.co.nz \
--to=nick@tenpoint.co.nz \
--cc=31371@debbugs.gnu.org \
--cc=alan@idiocy.org \
--cc=rpluim@gmail.com \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).