From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Nick Newsgroups: gmane.emacs.bugs Subject: bug#31371: 26.1; Menu-bar stops working after search Date: Mon, 14 Oct 2019 14:50:04 +1300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="139650"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) Cc: Robert Pluim , 31371@debbugs.gnu.org, Alan Third To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 14 03:51:43 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iJpWQ-000aAD-FG for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2019 03:51:43 +0200 Original-Received: from localhost ([::1]:43862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJpWP-0008OT-1V for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Oct 2019 21:51:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40326) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJpVu-0008LZ-Iw for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2019 21:51:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJpVq-0005Nt-1D for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2019 21:51:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJpVo-0005NX-DS for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2019 21:51:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iJpVm-0002rQ-6R for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2019 21:51:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nick Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Oct 2019 01:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31371 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31371-submit@debbugs.gnu.org id=B31371.157101782110909 (code B ref 31371); Mon, 14 Oct 2019 01:51:02 +0000 Original-Received: (at 31371) by debbugs.gnu.org; 14 Oct 2019 01:50:21 +0000 Original-Received: from localhost ([127.0.0.1]:37382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJpV6-0002pt-Hx for submit@debbugs.gnu.org; Sun, 13 Oct 2019 21:50:20 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:54215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJpV2-0002pX-Ac for 31371@debbugs.gnu.org; Sun, 13 Oct 2019 21:50:17 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 23162345; Sun, 13 Oct 2019 21:50:10 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 13 Oct 2019 21:50:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenpoint.co.nz; h=to:cc:subject:references:from:date:in-reply-to:message-id :mime-version:content-type; s=fm1; bh=nrRjLAf2TpIi9Zs0e9vDLEcvSY gM8110dYSOYZgZYvE=; b=RBKXVmbUvczBrxYSgB71m9bze/pSUk/1xR8I71VFqY LzSgtwdqDKGuQJZMg7Mz/5s8psEzaGLtcBzI1TaRGIV0Fwys1ydzdPnigR0ffSq5 aO5lcwFoPlMeM/MjsMk/woIc5vA7oyF6kVHIXFX9o25fi6y6PY9pOZZOlbvsZy79 eABfc2jILkrjha5NkZpcDC9NZPdfm+/JoDnpPhHi4C06RCXpj4krp9PSUb1Jm/bM gBxxgWaz0q8b2FI5LXRubtoHuUAVj1wtBZZCfJh1MS3Eashug4dzb2cA9EYoTk8G 6aThUTQ5/WVeF9y9HvtCVoJsklsXY1lOjNX2lLo6z2Gw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=nrRjLA f2TpIi9Zs0e9vDLEcvSYgM8110dYSOYZgZYvE=; b=f3tDdT/iIS5askovf69/Qu sxNH5V1G3FEDmdw0O2WthvUoS8Yt70ihHlijQjtkfjoGlkzfn6MELCiAD4n3TZjK t/kA8WI/NV1waTTUglf98PrEXUxzzAtPOeOrM27qPzUm0PpF6BGfUY2pogC6jCFW n+5w4WZX4fR+lqqWCBFq84Sbb4cqWtv09d9y3JvzRTVInCy3Q3SiUdvJvs2XcSfH MhL/yPPfNcyiSurx7NyJ7ezig/uoEk5N2Y4OAoWVln65Dhdk7cIMJodFppBaeamn RvvbQC/jOCCAkx0T5xypuq7safQJ53hdFdyR6U6fioc+KUppXTP9/+X45WMHaiBg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrjedtgdehvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefvufhfhfffjgfkfgggtgesmhdtreertdertdenucfhrhhomheppfhitghkuceo nhhitghksehtvghnphhoihhnthdrtghordhniieqnecukfhppeduvdehrddvfeelrdduvd dtrdduledtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnihgtkhesthgvnhhpohhinhht rdgtohdrnhiinecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Original-Received: from jupiter.local (125-239-120-190-vdsl.sparkbb.co.nz [125.239.120.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D6ADD6005D; Sun, 13 Oct 2019 21:50:07 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Fri, 11 Oct 2019 13:25:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169179 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-unresponsive-Help-menu-in-macOS.patch >From 9ec201c229fdb8f9fbed1050961730daaf9db718 Mon Sep 17 00:00:00 2001 From: Nick Helm 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) --=-=-=--