Subject: Re: bug#42957: 28.0.50; Tool bar button click doesn't update the tool bar immediately

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 16 Oct 2020 11:10:24 +0200

Mauro Aranda <[email-masked]> writes:

> 4. Now click the foo-refresh button.  I expected the button to get
> disabled immediately, but that doesn't happen.
> 5. Click in the buffer, and the button will be disabled.

Yup; this problem is still present on the trunk.

> Could Emacs update the tool bar immediately when the user clicks on a
> tool bar button? Or am I forced (no pun intended) to use
> `force-mode-line-update' in the commands that may alter the
> enable/disable state of the tool bar buttons, even when the commands
> run because of a tool bar button click?

I don't know, but if Emacs can't do that, then this should be
documented, at least.  This is documented in other context, like:

--
  The menu bar does not recalculate which items are enabled every time you
look at a menu.  This is because the X toolkit requires the whole tree
of menus in advance.  To force recalculation of the menu bar, call
@code{force-mode-line-update} (@pxref{Mode Line Format}).
--

But not in the tool bar sections, as far as I can see.  But I guess if
the menu bar doesn't update automatically on enabling, then it would
perhaps be surprising that tool bars do.

So I think we should just document this quirk?  Any opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no