DragAndDropManager.st
changeset 2061 f847cebf016f
parent 2046 c3b6b135c33a
child 2062 54c1c37389a0
--- a/DragAndDropManager.st	Tue Sep 27 11:28:38 2005 +0200
+++ b/DragAndDropManager.st	Tue Sep 27 14:58:03 2005 +0200
@@ -1255,21 +1255,26 @@
 
     restoreBlock value.                 "/ restore context before start drag
 
-    escapePressed ~~ true ifTrue:[
+    escapePressed == true ifTrue:[^ self].
+
+    dropAction notNil ifTrue:[
         "/
-        "/ at least do the drop operation
+        "/ initiator wants to do it himself, manually.
+        "/ Thus, no feedBack operation invoked.
         "/
-        dropAction isNil ifTrue:[
-            dropContext doDrop
-        ] ifFalse:[
-            "/
-            "/ initiator wants to do it himself, manually.
-            "/ Thus, no feedBack operation invoked.
-            "/
-            dropAction value:(dropContext targetWidget)
-                       value:(dropContext targetId)
-                       value:(dropContext rootPoint)
-                       value:(dropContext targetPoint).
+        dropAction value:(dropContext targetWidget)
+                   value:(dropContext targetId)
+                   value:(dropContext rootPoint)
+                   value:(dropContext targetPoint).
+    ] ifFalse:[
+        dropContext doDrop
+    ].
+
+    "/ UI feels better, if the focus is assigned to the target view,
+    "/ if click-for-focus is on.
+    UserPreferences current focusFollowsMouse == false ifTrue:[
+        dropContext targetWidget wantsFocusWithButtonPress ifTrue:[
+            dropContext targetWidget requestFocus    
         ].
     ].
 !
@@ -1556,7 +1561,7 @@
 !DragAndDropManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.61 2005-05-30 19:25:09 ab Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.62 2005-09-27 12:58:03 cg Exp $'
 ! !
 
 DragAndDropManager initialize!