changeset 26573:e219195abf40

(w32-drag-n-drop): Load files in current window, if drop coords aren't over a specific window.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 24 Nov 1999 14:37:53 +0000
parents b96cb003aed2
children 5510d0cc07c3
files lisp/term/w32-win.el
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/w32-win.el	Wed Nov 24 14:36:36 1999 +0000
+++ b/lisp/term/w32-win.el	Wed Nov 24 14:37:53 1999 +0000
@@ -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.  <skx@tardis.ed.ac.uk>
+    (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.