From 579d7c20da5406575e087e4e8cb0a5621d28037b Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 19 Dec 2021 09:43:26 +0800 Subject: [PATCH] Add missing implementation of `pgtk-menu-bar-open' * lisp/term/pgtk-win.el (pgtk-menu-bar-open): New function. (bug#52604) --- lisp/term/pgtk-win.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- 2.39.2