]> git.eshelyaron.com Git - emacs.git/commitdiff
Update menu bars when `use-system-tooltips' changes on Haiku
authorPo Lu <luangruo@yahoo.com>
Fri, 21 Jan 2022 01:31:27 +0000 (01:31 +0000)
committerPo Lu <luangruo@yahoo.com>
Fri, 21 Jan 2022 01:31:27 +0000 (01:31 +0000)
* lisp/term/haiku-win.el: Add new function as variable watcher
for `use-system-tooltips'.
(haiku-use-system-tooltips-watcher): New function.

lisp/term/haiku-win.el

index a5cde929f963220b2c26cdd8f19c2b0bb493adfb..4c06f7f58aaf04ff6ad9d57c784bbd306ff4b88a 100644 (file)
@@ -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)