summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/haiku-win.el16
-rw-r--r--lisp/term/pgtk-win.el2
-rw-r--r--lisp/term/x-win.el20
3 files changed, 34 insertions, 4 deletions
diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el
index ff9402c4acb..4c06f7f58aa 100644
--- a/lisp/term/haiku-win.el
+++ b/lisp/term/haiku-win.el
@@ -50,6 +50,7 @@
(declare-function haiku-selection-data "haikuselect.c")
(declare-function haiku-selection-put "haikuselect.c")
(declare-function haiku-selection-targets "haikuselect.c")
+(declare-function haiku-selection-owner-p "haikuselect.c")
(declare-function haiku-put-resource "haikufns.c")
(defun haiku--handle-x-command-line-resources (command-line-resources)
@@ -105,9 +106,8 @@ If TYPE is nil, return \"text/plain\"."
&context (window-system haiku))
(haiku-selection-data selection "text/plain"))
-(cl-defmethod gui-backend-selection-owner-p (_
- &context (window-system haiku))
- t)
+(cl-defmethod gui-backend-selection-owner-p (selection &context (window-system haiku))
+ (haiku-selection-owner-p selection))
(declare-function haiku-read-file-name "haikufns.c")
@@ -136,6 +136,16 @@ If TYPE is nil, return \"text/plain\"."
(define-key special-event-map [drag-n-drop]
'haiku-dnd-handle-drag-n-drop-event)
+(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)
diff --git a/lisp/term/pgtk-win.el b/lisp/term/pgtk-win.el
index 9bcf3eac646..25f3a851dcc 100644
--- a/lisp/term/pgtk-win.el
+++ b/lisp/term/pgtk-win.el
@@ -510,6 +510,8 @@ This uses `icon-map-list' to map icon file names to stock icon names."
(t
(popup-menu (mouse-menu-bar-map) last-nonmenu-event))))
+(defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips)
+
(provide 'pgtk-win)
(provide 'term/pgtk-win)
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index e52e488edab..019a01e22ca 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1527,16 +1527,32 @@ This uses `icon-map-list' to map icon file names to stock icon names."
(defvar x-preedit-overlay nil
"The overlay currently used to display preedit text from a compose sequence.")
+;; With some input methods, text gets inserted before Emacs is told to
+;; remove any preedit text that was displayed, which causes both the
+;; preedit overlay and the text to be visible for a brief period of
+;; time. This pre-command-hook clears the overlay before any command
+;; and should be set whenever a preedit overlay is visible.
+(defun x-clear-preedit-text ()
+ "Clear the pre-edit overlay and remove itself from pre-command-hook.
+This function should be installed in `pre-command-hook' whenever
+preedit text is displayed."
+ (when x-preedit-overlay
+ (delete-overlay x-preedit-overlay)
+ (setq x-preedit-overlay nil))
+ (remove-hook 'pre-command-hook #'x-clear-preedit-text))
+
(defun x-preedit-text (event)
"Display preedit text from a compose sequence in EVENT.
EVENT is a preedit-text event."
(interactive "e")
(when x-preedit-overlay
(delete-overlay x-preedit-overlay)
- (setq x-preedit-overlay nil))
+ (setq x-preedit-overlay nil)
+ (remove-hook 'pre-command-hook #'x-clear-preedit-text))
(when (nth 1 event)
(let ((string (propertize (nth 1 event) 'face '(:underline t))))
(setq x-preedit-overlay (make-overlay (point) (point)))
+ (add-hook 'pre-command-hook #'x-clear-preedit-text)
(overlay-put x-preedit-overlay 'window (selected-window))
(overlay-put x-preedit-overlay 'before-string
(if x-display-cursor-at-start-of-preedit-string
@@ -1545,6 +1561,8 @@ EVENT is a preedit-text event."
(define-key special-event-map [preedit-text] 'x-preedit-text)
+(defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips)
+
(provide 'x-win)
(provide 'term/x-win)