[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 579d7c2: Add missing implementation of `pgtk-menu-bar-open'

From: Po Lu
Subject: master 579d7c2: Add missing implementation of `pgtk-menu-bar-open'
Date: Sat, 18 Dec 2021 20:45:04 -0500 (EST)

branch: master
commit 579d7c20da5406575e087e4e8cb0a5621d28037b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Add missing implementation of `pgtk-menu-bar-open'
    * lisp/term/pgtk-win.el (pgtk-menu-bar-open): New function.
 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 689a5e5..bd925a0 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))))
+(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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]