summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-04-03 01:26:32 +0000
committerPo Lu <luangruo@yahoo.com>2022-04-03 01:26:32 +0000
commite9d4f119da48fe119d9d7a6d1b9a054c043bd517 (patch)
tree86e63831d640bedbb71ad5a3087700e8fd4c8e64 /lisp
parent1694f82e5f91f1ea96604c7c0aee4537fbada765 (diff)
downloademacs-e9d4f119da48fe119d9d7a6d1b9a054c043bd517.tar.gz
Implement new DND options on Haiku
* lisp/term/haiku-win.el (haiku-drag-and-drop): Handle special drag and drop motion events. * src/haiku_support.cc (MouseMoved): Set `dnd_message' flag. * src/haiku_support.h (struct haiku_mouse_motion_event): New member `dnd_message'. * src/haikuterm.c (haiku_read_socket): Create special DND events when the mouse moves with a drop message.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/term/haiku-win.el37
1 files changed, 20 insertions, 17 deletions
diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el
index 810feced212..5b4ef0aaef8 100644
--- a/lisp/term/haiku-win.el
+++ b/lisp/term/haiku-win.el
@@ -245,23 +245,26 @@ VALUE will be encoded as UTF-8 and stored under the type
(interactive "e")
(let* ((string (caddr event))
(window (posn-window (event-start event))))
- (cond
- ((assoc "refs" string)
- (with-selected-window window
- (raise-frame)
- (dolist (filename (cddr (assoc "refs" string)))
- (dnd-handle-one-url window 'private
- (concat "file:" filename)))))
- ((assoc "text/plain" string)
- (with-selected-window window
- (raise-frame)
- (dolist (text (cddr (assoc "text/plain" string)))
- (goto-char (posn-point (event-start event)))
- (dnd-insert-text window 'private
- (if (multibyte-string-p text)
- text
- (decode-coding-string text 'undecided))))))
- (t (message "Don't know how to drop any of: %s" (mapcar #'car string))))))
+ (if (eq string 'lambda) ; This means the mouse moved.
+ (dnd-handle-movement (event-start event))
+ (cond
+ ((assoc "refs" string)
+ (with-selected-window window
+ (raise-frame)
+ (dolist (filename (cddr (assoc "refs" string)))
+ (dnd-handle-one-url window 'private
+ (concat "file:" filename)))))
+ ((assoc "text/plain" string)
+ (with-selected-window window
+ (raise-frame)
+ (dolist (text (cddr (assoc "text/plain" string)))
+ (goto-char (posn-point (event-start event)))
+ (dnd-insert-text window 'private
+ (if (multibyte-string-p text)
+ text
+ (decode-coding-string text 'undecided))))))
+ (t (message "Don't know how to drop any of: %s"
+ (mapcar #'car string)))))))
(define-key special-event-map [drag-n-drop]
'haiku-drag-and-drop)