Subject: bug#51199: describe-key on a toolbar item throws an error

From: Eli Zaretskii <[email-masked]>
Date: Thu, 14 Oct 2021 12:31:23 +0300

> Date: Thu, 14 Oct 2021 16:08:29 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> In master and the latest emacs-28, I get:
> mouse-minibuffer-check: Wrong type argument: window-valid-p, #<frame *Backtrace* - GNU Emacs at shredder 0x11509a60f7e8>
> When I press C-h k and then click a button on the toolbar.  (This won't
> be reproducible if you have toolkit tool bars).
> 
> This used to work in Emacs 27, and is very useful when I want to check
> what a button on the toolbar does.  It would be appreciated if someone
> looked into this.  Thanks.

That's something Stefan said in another bug report:
mouse-minibuffer-check assumes too much about posn-window.

Should be fixed now on the emacs-28 branch.