summaryrefslogtreecommitdiff
path: root/lisp/tooltip.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-29 18:53:28 +0800
committerPo Lu <luangruo@yahoo.com>2022-01-29 18:57:08 +0800
commite380fb509b1c506e5745eafc61e053ca6455fe62 (patch)
tree1f265140fe9b966361fbf4b3a9f39cbbc584e5f9 /lisp/tooltip.el
parent0a5ece3da157c5a33023dfdf6211fc34015f197d (diff)
downloademacs-e380fb509b1c506e5745eafc61e053ca6455fe62.tar.gz
Fix unrelated help text tooltips if a popup is shown during the delay
* doc/lispref/frames.texi (Pop-Up Menus): Document new hook. * etc/NEWS: Announce `x-pre-popup-menu-hook'. * lisp/tooltip.el (tooltip-mode): Make sure `tooltip-hide' is run before any popup menu is displayed to prevent unrelated help text from obscuring the popup menu if it pops up during the tooltip delay. * src/menu.c (x_popup_menu_1): Run said hook right before the popup menu is displayed. (syms_of_menu): New hook `x-pre-popup-menu-hook'.
Diffstat (limited to 'lisp/tooltip.el')
-rw-r--r--lisp/tooltip.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 9d523e79679..0ee3c38e26d 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -58,9 +58,11 @@ echo area, instead of making a pop-up window."
(if (and tooltip-mode (fboundp 'x-show-tip))
(progn
(add-hook 'pre-command-hook 'tooltip-hide)
- (add-hook 'tooltip-functions 'tooltip-help-tips))
+ (add-hook 'tooltip-functions 'tooltip-help-tips)
+ (add-hook 'x-pre-popup-menu-hook 'tooltip-hide))
(unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
- (remove-hook 'pre-command-hook 'tooltip-hide))
+ (remove-hook 'pre-command-hook 'tooltip-hide)
+ (remove-hook 'x-pre-popup-menu-hook 'tooltip-hide))
(remove-hook 'tooltip-functions 'tooltip-help-tips))
(setq show-help-function
(if tooltip-mode 'tooltip-show-help 'tooltip-show-help-non-mode)))