summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-21 01:31:27 +0000
committerPo Lu <luangruo@yahoo.com>2022-01-21 01:31:27 +0000
commit7269106578fc1e7e4843457b4b25bff521aa58d5 (patch)
tree55d5bcd4cfa0e79076b9c899be6884905eb7d13c
parent452f46d3665e1bfab93ec14003484ce57b636471 (diff)
downloademacs-7269106578fc1e7e4843457b4b25bff521aa58d5.tar.gz
Update menu bars when `use-system-tooltips' changes on Haiku
* lisp/term/haiku-win.el: Add new function as variable watcher for `use-system-tooltips'. (haiku-use-system-tooltips-watcher): New function.
-rw-r--r--lisp/term/haiku-win.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el
index a5cde929f96..4c06f7f58aa 100644
--- a/lisp/term/haiku-win.el
+++ b/lisp/term/haiku-win.el
@@ -138,6 +138,14 @@ If TYPE is nil, return \"text/plain\"."
(defvaralias 'haiku-use-system-tooltips 'use-system-tooltips)
+(defun haiku-use-system-tooltips-watcher (&rest _ignored)
+ "Variable watcher to force a menu bar update when `use-system-tooltip' changes.
+This is necessary because on Haiku `use-system-tooltip' doesn't
+take effect on menu items until the menu bar is updated again."
+ (force-mode-line-update t))
+
+(add-variable-watcher 'use-system-tooltips #'haiku-use-system-tooltips-watcher)
+
(provide 'haiku-win)
(provide 'term/haiku-win)