]> git.eshelyaron.com Git - emacs.git/commitdiff
Update Haiku drag-and-drop code
authorPo Lu <luangruo@yahoo.com>
Tue, 7 Jun 2022 02:44:08 +0000 (02:44 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 7 Jun 2022 02:44:08 +0000 (02:44 +0000)
* lisp/term/haiku-win.el (haiku-drag-and-drop): Don't allow
dropping on places other than the text area (it doesn't work).
Also respect mouse-yank-at-point.

lisp/term/haiku-win.el

index 0dcfc1e92050a3e0f4176042ac713f2db5b45d2e..6ddf546ee576ddb225b3eaa109e394c48bf52be8 100644 (file)
@@ -311,6 +311,9 @@ or a pair of markers) and turns it into a file system reference."
     (if (eq string 'lambda) ; This means the mouse moved.
         (dnd-handle-movement (event-start event))
       (cond
+       ;; Don't allow dropping on something other than the text area.
+       ;; It does nothing and doesn't work with text anyway.
+       ((posn-area (event-start event)))
        ((assoc "refs" string)
         (with-selected-window window
           (raise-frame)
@@ -326,7 +329,8 @@ or a pair of markers) and turns it into a file system reference."
         (with-selected-window window
           (raise-frame)
           (dolist (text (cddr (assoc "text/plain" string)))
-            (goto-char (posn-point (event-start event)))
+            (unless mouse-yank-at-point
+              (goto-char (posn-point (event-start event))))
             (dnd-insert-text window 'private
                              (if (multibyte-string-p text)
                                  text