From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#32864: 26.1; menus don't work correctly in Mac OS Mojave Date: Wed, 5 Jun 2019 22:27:19 +0100 Message-ID: <20190605212719.GA39840@breton.holly.idiocy.org> References: <20190604164446.GB23349@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="209105"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.12.0 (2019-05-25) Cc: Robert Pluim , omari@smileystation.com, 32864@debbugs.gnu.org, artemiog@mac.com, simon@simonscientific.com To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 05 23:28:17 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYdSC-000sAh-SY for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jun 2019 23:28:17 +0200 Original-Received: from localhost ([127.0.0.1]:50464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYdSB-0007qC-C0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Jun 2019 17:28:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYdS4-0007pw-Us for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2019 17:28:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYdRz-0002i0-6e for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2019 17:28:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYdRy-0002cE-46 for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2019 17:28:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hYdRx-0006i7-U6 for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2019 17:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jun 2019 21:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32864 X-GNU-PR-Package: emacs Original-Received: via spool by 32864-submit@debbugs.gnu.org id=B32864.155977005125749 (code B ref 32864); Wed, 05 Jun 2019 21:28:01 +0000 Original-Received: (at 32864) by debbugs.gnu.org; 5 Jun 2019 21:27:31 +0000 Original-Received: from localhost ([127.0.0.1]:48341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYdRS-0006hE-Gy for submit@debbugs.gnu.org; Wed, 05 Jun 2019 17:27:30 -0400 Original-Received: from mail-wm1-f50.google.com ([209.85.128.50]:55174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYdRQ-0006gz-ON for 32864@debbugs.gnu.org; Wed, 05 Jun 2019 17:27:29 -0400 Original-Received: by mail-wm1-f50.google.com with SMTP id g135so306829wme.4 for <32864@debbugs.gnu.org>; Wed, 05 Jun 2019 14:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=dwehvC3rEqlCeJpZyIf0M/PzuT71eyy7lcF2d/QxDtI=; b=pVfcyB+UOBjpGoemNDU9eMmSk3cuxj8SUN6p4u9Sk5bs6Nhks8uUTLRhfQ0+cZLTsp 86dTD7zBx+ByIFpAINZTQHGtyMV1DsWhxm4EfqveFIV9iik3vyNUpNs/POxPgy3014Gn 7jrTy7mJisLdA/bkWZotLpfsicNNzNsUgzOCEZoa0sOH4zAc/7ODZe/wlCd7xwWaU/fn 880qIgV78zorKam91I3reQg1v4AVNmqjRwMGhPdTLqxoDjb0yyfbYsf7/LSNN2s8VcOo Wvm5IC/p/ulcNP+cvHc3PlLBDduEty+DCjiktiJd/y+D3J9pr3+hYJTLaP/ozozqEQm8 dx1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=dwehvC3rEqlCeJpZyIf0M/PzuT71eyy7lcF2d/QxDtI=; b=sgcHe1/r0a/6tLIJ2vbxq9fq0O6EJVctBBLkOaiNUx2am6xBbiRU5MTGWwtWB7PECc RHDi09Zu9djFN45h9zFr+SYPv93NRQZY/pUYsZUGJ+UA3NK8w1zyl98frlSOGsWQ7tvw ovVtrWvltkahtZaDlUh24Xfcfe2IhYUst/+F14mxov8FeFnEwPZEEK1cqsjYjoSZqvOy G/rFtsdYqVgu64rBW01FXduvJMZwUuRYOPtoN1w0DxuG2aDm4RS4PbHFmZQ/fZlTOhaf 6QkrjaimDDp+/NtWjR88ZW4ZfP9ZO8z3APWMUg52X7Hg2ykr/vwdsTpdL8+UilgcbhDK 01RA== X-Gm-Message-State: APjAAAXnEKCDEjliwRnmVUEoZvisnfmNK4jD5+DMkPJm/15wEMBu4JJ+ WY12clKN/a7qZEBuPG2E3xY= X-Google-Smtp-Source: APXvYqx92kfsWWthkY9MjP/ftd3MGqN79FlXqfjiFjFBHwoQoLXa9+aEwfq+a0cwpvC20aadEZ62Wg== X-Received: by 2002:a1c:808b:: with SMTP id b133mr11135682wmd.160.1559770042549; Wed, 05 Jun 2019 14:27:22 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-f5f8-805d-6999-41dd.holly.idiocy.org. [2001:8b0:3f8:8129:f5f8:805d:6999:41dd]) by smtp.gmail.com with ESMTPSA id c16sm7206717wrr.53.2019.06.05.14.27.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 14:27:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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:160168 Archived-At: On Tue, Jun 04, 2019 at 11:08:10PM +0200, Mattias Engdegård wrote: > 4 juni 2019 kl. 18.44 skrev Alan Third : > > > > It may also be the case that Emacs can try to run the event loop from > > within elisp code as a matter of course. > > I'm no Cocoa expert, but the docs explicitly state that recursively entering an event loop from an event handler is allowed. Unfortunately I too am no expert. Perhaps I’ve misunderstood what was going on. > > The other solution I found is to rebuild the menu completely whenever > > lisp updates it. This is simple enough to do but rebuilding the menus > > takes something like 40‐70ms every time, as opposed to 1‐2ms to just > > rebuild the top level, and it can do it up to three times per > > keypress. I think it may also do it sometimes while scrolling. It > > didn’t seem like a good idea to me. On the other hand I don’t remember > > actually having much trouble with it. > > Is the entire menu rebuilt every time some part of it changes, or > are the changes segregated by drop-down menu? The Buffers menu > probably sees a lot of traffic; it seems to be updated from > menu-bar-update-hook, which fires a lot, even though most of the > time the buffer list doesn't actually change. IIRC set_frame_menubar is called with deep_p set to false and this calls ns_update_menubar just recreating the top level. When you click on a menu it does all the stuff you described previously which ends up running ns_update_menubar with deep_p set to true and this rebuilds the menu that was clicked on. I think. I don’t think it rebuilds all menus. > > If anyone has any other ideas I’d be happy to hear them. > > The emacs-mac port, which seems to be an AppKit/Carbon hybrid (?), > does not exhibit this menu glitch. I'm not sure exactly how it does > this, but the general approach looks roughly similar. Maybe we could > ask its author for advice. Seems like a good idea. Yamamoto‐san, I hope it’s OK to pull you into this discussion. Do you have any thoughts on the issue described in: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32864#38 -- Alan Third