# HG changeset patch # User Gerd Moellmann # Date 943454273 0 # Node ID e219195abf406d44fd89ba64cd86dc328523d51e # Parent b96cb003aed294ea4ca4520ece64ed20a29d5d1a (w32-drag-n-drop): Load files in current window, if drop coords aren't over a specific window. diff -r b96cb003aed2 -r e219195abf40 lisp/term/w32-win.el --- 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. + (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.