unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: "Gerd Möllmann" <gerd.moellmann@gmail.com>,
	"Eli Zaretskii" <eliz@gnu.org>,
	56155@debbugs.gnu.org, "Stefan Kangas" <stefan@marxist.se>
Subject: bug#56155: 29.0.50; Options menu, toggle menu items not updated
Date: Wed, 29 Jun 2022 14:12:11 +0800	[thread overview]
Message-ID: <87a69wathg.fsf@yahoo.com> (raw)
In-Reply-To: <m1pmis740t.fsf@yahoo.es> ("Daniel Martín"'s message of "Wed, 29 Jun 2022 01:38:10 +0200")

Daniel Martín <mardani29@yahoo.es> 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.





  parent reply	other threads:[~2022-06-29  6:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  9:09 bug#56155: 29.0.50; Options menu, toggle menu items not updated Gerd Möllmann
2022-06-23 10:15 ` Eli Zaretskii
2022-06-28 12:06   ` Gerd Möllmann
2022-06-28 21:21     ` Stefan Kangas
2022-06-28 23:38       ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  5:32         ` Gerd Möllmann
2022-06-29  6:12         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-06-29  8:44           ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  8:53             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29  6:04   ` Gerd Möllmann
2022-06-29 10:16     ` Lars Ingebrigtsen

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=87a69wathg.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=56155@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=luangruo@yahoo.com \
    --cc=mardani29@yahoo.es \
    --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).