code cleanup
authorClaus Gittinger <cg@exept.de>
Wed, 05 Oct 2005 14:13:42 +0200
changeset 2063 dc16836d45dc
parent 2062 54c1c37389a0
child 2064 429bdc16e515
code cleanup
DragAndDropManager.st
--- a/DragAndDropManager.st	Fri Sep 30 10:46:22 2005 +0200
+++ b/DragAndDropManager.st	Wed Oct 05 14:13:42 2005 +0200
@@ -1247,6 +1247,7 @@
 !
 
 buttonRelease:button x:x y:y view:aView
+    |targetWidget|
 
     ((button == 1) or:[button == #select]) ifFalse:[
         ^ self
@@ -1257,12 +1258,13 @@
 
     escapePressed == true ifTrue:[^ self].
 
+    targetWidget := dropContext targetWidget.
     dropAction notNil ifTrue:[
         "/
         "/ initiator wants to do it himself, manually.
         "/ Thus, no feedBack operation invoked.
         "/
-        dropAction value:(dropContext targetWidget)
+        dropAction value:(targetWidget)
                    value:(dropContext targetId)
                    value:(dropContext rootPoint)
                    value:(dropContext targetPoint).
@@ -1278,9 +1280,10 @@
 "/            dropContext targetWidget requestFocus    
 "/        ].
 "/    ].
-    dropContext targetWidget topView setForegroundWindow.    
-    dropContext targetWidget topView activate.
-    dropContext targetWidget takeFocus.    
+    targetWidget notNil ifTrue:[
+        targetWidget topView setForegroundWindow; activate.
+        targetWidget takeFocus.    
+    ].
 !
 
 escapePressed
@@ -1565,7 +1568,7 @@
 !DragAndDropManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.63 2005-09-30 08:46:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.64 2005-10-05 12:13:42 cg Exp $'
 ! !
 
 DragAndDropManager initialize!