summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
authorMasatake YAMATO <yamato@redhat.com>2012-07-20 07:32:30 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-07-20 07:32:30 -0400
commitbbf0e7d97893b9abfe6575a408f03e48543cb513 (patch)
tree4c902d028a64bffea758f2c5e78817a1f853549c /lisp/term
parentc28662a8dc4fefae711b21fcb7a71e871e37d1e6 (diff)
downloademacs-bbf0e7d97893b9abfe6575a408f03e48543cb513.tar.gz
* lisp/term/x-win.el (x-menu-bar-open): Use `frame-parameter'
to check whether menu-bar is shown or not. If not shown, show the menu-bar as a popup menu instead of using tmm. * lisp/mouse.el (popup-menu): Accept `point' as `position' argument.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/x-win.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 498cc01fe22..fb7389b856c 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1305,12 +1305,18 @@ Request data types in the order specified by `x-select-request-type'."
(declare-function accelerate-menu "xmenu.c" (&optional frame) t)
(defun x-menu-bar-open (&optional frame)
- "Open the menu bar if `menu-bar-mode' is on, otherwise call `tmm-menubar'."
+ "Open the menu bar if it is shown.
+`popup-menu' is used if it is off "
(interactive "i")
- (if (and menu-bar-mode
- (fboundp 'accelerate-menu))
- (accelerate-menu frame)
- (tmm-menubar)))
+ (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)
+ (if (listp last-nonmenu-event)
+ nil
+ 'point)))))
;;; Window system initialization.