pane-has-focus-p cannot be used in menu functions such as the
of a menu item. It will always return
nil, because the focus is on the menu button when the user clicks on it.
CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017