From: Po Lu Date: Sun, 19 Dec 2021 01:43:26 +0000 (+0800) Subject: Add missing implementation of `pgtk-menu-bar-open' X-Git-Tag: emacs-29.0.90~3577^2~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=579d7c20da5406575e087e4e8cb0a5621d28037b;p=emacs.git Add missing implementation of `pgtk-menu-bar-open' * lisp/term/pgtk-win.el (pgtk-menu-bar-open): New function. (bug#52604) --- diff --git a/lisp/term/pgtk-win.el b/lisp/term/pgtk-win.el index 689a5e595a5..bd925a01299 100644 --- a/lisp/term/pgtk-win.el +++ b/lisp/term/pgtk-win.el @@ -497,6 +497,18 @@ This uses `icon-map-list' to map icon file names to stock icon names." (and value (cdr value)))) x-gtk-stock-cache)))) +(declare-function accelerate-menu "pgtkmenu.c" (&optional frame) t) + +(defun pgtk-menu-bar-open (&optional frame) + "Open the menu bar if it is shown. +`popup-menu' is used if it is off." + (interactive "i") + (cond + ((and (not (zerop (or (frame-parameter nil 'menu-bar-lines) 0))) + (fboundp 'accelerate-menu)) + (accelerate-menu frame)) + (t + (popup-menu (mouse-menu-bar-map) last-nonmenu-event)))) (provide 'pgtk-win) (provide 'term/pgtk-win)