diff options
author | Po Lu <luangruo@yahoo.com> | 2021-12-19 09:43:26 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-12-19 09:43:26 +0800 |
commit | 579d7c20da5406575e087e4e8cb0a5621d28037b (patch) | |
tree | 88cf1d387c0f88cdd04118ddc6edb39bda34a661 /lisp | |
parent | 1fce1d99d4f0b37481dce19bebaf93ccffde4cff (diff) | |
download | emacs-579d7c20da5406575e087e4e8cb0a5621d28037b.tar.gz emacs-579d7c20da5406575e087e4e8cb0a5621d28037b.tar.bz2 emacs-579d7c20da5406575e087e4e8cb0a5621d28037b.zip |
Add missing implementation of `pgtk-menu-bar-open'
* lisp/term/pgtk-win.el (pgtk-menu-bar-open): New function.
(bug#52604)
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/term/pgtk-win.el | 12 |
1 files changed, 12 insertions, 0 deletions
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) |