aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>1999-11-24 14:37:53 +0000
committerGerd Moellmann <[email protected]>1999-11-24 14:37:53 +0000
commit35a8911d3950448a8c199eec2030e2e2c066132f (patch)
tree0fcb3559db376451df99d6456c4d18c2a2d98d3a /lisp
parent5562b47fcd2826daac93a2c256d430a21aa1287a (diff)
(w32-drag-n-drop): Load files in current window, if
drop coords aren't over a specific window.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/term/w32-win.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 5067b46d15..a46f2334e9 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -156,9 +156,17 @@
Switch to a buffer editing the last file dropped."
(interactive "e")
(save-excursion
- (set-frame-selected-window nil (posn-window (event-start event)))
- (mapcar 'find-file (car (cdr (cdr event)))))
- (raise-frame))
+ ;; Make sure the drop target has positive co-ords
+ ;; before setting the selected frame - otherwise it
+ ;; won't work. <[email protected]>
+ (let* ((window (posn-window (event-start event)))
+ (coords (posn-x-y (event-start event)))
+ (x (car coords))
+ (y (cdr coords)))
+ (if (and (> x 0) (> y 0))
+ (set-frame-selected-window nil window))
+ (mapcar 'find-file (car (cdr (cdr event)))))
+ (raise-frame)))
(defun w32-drag-n-drop-other-frame (event)
"Edit the files listed in the drag-n-drop event, in other frames.