From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56155: 29.0.50; Options menu, toggle menu items not updated Date: Wed, 29 Jun 2022 14:12:11 +0800 Message-ID: <87a69wathg.fsf@yahoo.com> References: <83pmizele6.fsf@gnu.org> <12D696D2-1502-48DC-8FD7-20183C47EDAD@gmail.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4552"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , Eli Zaretskii , 56155@debbugs.gnu.org, Stefan Kangas To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 29 08:13:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6Qww-000133-ND for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 08:13:18 +0200 Original-Received: from localhost ([::1]:45464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Qwv-0006aT-Jn for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 02:13:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Qwg-0006a7-6g for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2022 02:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6Qwf-0006Ot-U5 for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2022 02:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6Qwf-0007A0-Ng for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2022 02:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jun 2022 06:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56155 X-GNU-PR-Package: emacs Original-Received: via spool by 56155-submit@debbugs.gnu.org id=B56155.165648314727477 (code B ref 56155); Wed, 29 Jun 2022 06:13:01 +0000 Original-Received: (at 56155) by debbugs.gnu.org; 29 Jun 2022 06:12:27 +0000 Original-Received: from localhost ([127.0.0.1]:56958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6Qw7-000797-C6 for submit@debbugs.gnu.org; Wed, 29 Jun 2022 02:12:27 -0400 Original-Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:40807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6Qw5-00078u-Kw for 56155@debbugs.gnu.org; Wed, 29 Jun 2022 02:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1656483140; bh=1IHQ7MNXRYkBCfDTTCvlhHx3u2vVk29fus4m26rB7pc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=DG9MybXSv65iGXDBT9WYtzCWZu9G3+oIbckxJ/7SGIelZMWM3N99Y6QOsVg5T9D0fMoagzbwBRPyDbwXmUSB7LrIpbl8yNrAXK2J0aSwJTLYhUCpuvVo04gHBI/i3AHs2zaX3lsRsMbcABnPGN5kJuYXm2RN1CU7t7cBFkyK1TsLCjYgXu/nbVaR5dHT63oa7tT/tBmW8GjeKgSY9Dh+IqZnBfn9qWFBFGFO/EUT/JA7vq1eKc6diFzdrCzd815G4ATRKYN8ORI48JzHjy6n8vsoDOjYj4qHhQICn0OHdUzJM9WRF4E7qYIX1ud4ohZPn5pKvlPXl8rZKtPIW54gnA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1656483140; bh=4u8LjlCqJdfoWEN4VxD7WJ848DaswFK++hOwZrALwuD=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=r5OcwmrYlcojMVce9siYVerQy1TTtzFlCHBowne/0YXFpCg5PHLRvkm9zh9Saq1rkPlBRt3uUFw+jWIEutLkLsauo8zR8QA1KlhgAU2d+14zX1cUn8QCMqM2HnkJ/P49mayeTkYD6wKhX87lzsesyly9v/woS8wSbUvRQBHvnTEDgr6BQI/QdKvYCqbeAg0UR0a9ByIDNlfNIWHf2OO4DDZZ0KleL2IBy1BIQvo6seQnCLSI7dFqcu/a54025PFpzEZMPOAoJ96VRbZHylBKoU411IfkdSTzkZtiLcixLdrwah36mk998DlMPb3HRDAeIFOkbzmpvr6pa7mEH7Af1Q== X-YMail-OSG: KXC4HoQVM1nYWMjdWvIifPzTWFD08Z5ch31BmkgjgodhVFzd1_KqbJUSnDAXvLC pRRhuxZdWUsYuUgoO_GTS9nmmD9n0G8vMLFu2VMnVW.8BiW3v2Dl.G329BIYrH08lqkOuiP_HyUf 7tv24FL0ne6FCioThXo.Mjlx9iK17W7WwQnFkMfM9ETuYaiSM2qKACyCbh2bwLpfohq9X3qGdR7U WoCLzvIXu6MAv.7ZgNOErTNxIFxiPfvESTwOfKHncqJ0gddWbrxcyru62.cSmjDt5Q6R.tILSL5G 35JvZMGaE5EZ2hpawEn.tFpjiVitubiv1vnWhtweqyXhbeZ_4NisisoGGIzg_78Haa4xTxtv0.wT FYd2gw8EB5QYB.dLqgzmZaOGJgYSEiJ4nGkMjmeMuvyhTz0o0DCUSBvaFeHd8Ck6Q4Ihleh0VRzb VFmGYnIb4aS8M_v7rpKncvJbz8Cvqj.n3mNvSl_QLvN9gvv3_v5qr_U5dc5p.i1RWRuD7MCNfWwG nMgxhKOacjdPx.axbS4iYNukw6LeGoAxAY2zoqdSz1vKf3tHBQrs0YADWGATXIXn3dnGJbsgMF7D ba3vfh6zj1DduVFA9KjLUgdD9HJ_VKI.Bd77T0NkDwCr6LMoMV1Itq7tCCOxBN_8qt9p2QIlhv2H pBxeVvPplRrVetXDOzyI_Z.RERw40QmOZWjn1VooETf_RijEsC1UdPkG1rqedOxfG7fA9a_mMwRy 9U6qDxzJ6faYLG15Vo_Up0S0MV6Zb_GAa1YKTWQu8j5DTFo9jGv5yGB0G_wxiRgNFK7RfdlgqH.l PSgtht5coxa9ZlgWKbhLzOlrx6EvQX3Fr1trx.FWxf X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 29 Jun 2022 06:12:20 +0000 Original-Received: by hermes--canary-production-sg3-67975bbd4b-zlmw9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 41b8d9dc2da6bc3b94c2b0113865799e; Wed, 29 Jun 2022 06:12:16 +0000 (UTC) In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?="'s message of "Wed, 29 Jun 2022 01:38:10 +0200") X-Mailer: WebService/1.1.20280 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235598 Archived-At: Daniel Mart=C3=ADn writes: > That's interesting. Could you put a breakpoint on that C function on > GNU/Linux to see if it's called, for example, when you close the menu? > That may be the key difference between macOS and the other operating > systems. I don't have a GNU/Linux system at hand right now, but I can > investigate if needed. > > (BTW, as an aside, getting a Lisp backtrace using LLDB on macOS is a bit > time-consuming because of all the manual steps to print the pointer > structures. If I have time, I'd like to write an .lldbinit file with > LLDB commands to make this process much simpler, although I don't know > how many people are debugging Emacs using LLDB here.) The problem is well known (to me, at least.) [EmacsMenu menuNeedsUpdate:] only updates the menu bar if it was actually "dirtied" by a previous "shallow" update (see set_frame_menubar in nsmenu.m), but that never happens when only the value of a toggle item changes. The other window systems intercept button presses on the menu bar, and run Lisp in the keyboard loop to update the menu bar, before pushing the button press event back onto the event queue. But I can't figure out how to do that on NS, and [EmacsMenu menuNeedsUpdate:] is called too often to not utilize the "dirty" flag. If someone does find out how to intercept events that will open the menu bar, then most of the NS menu bar updating logic can be thrown out the window, which will resolve not just this problem, but several others as well.