SimpleView.st
changeset 8852 3ef1ae558f0e
parent 8848 a939ec8fbfd5
child 8853 c34c5c02f6d5
--- a/SimpleView.st	Sun Oct 20 12:00:49 2019 +0200
+++ b/SimpleView.st	Sun Oct 20 13:14:34 2019 +0200
@@ -7403,15 +7403,17 @@
     (ev isButtonEvent or:[ev isPointerEnterLeaveEvent]) ifTrue:[
         "/ if there is a pointer grab, the event has to sent to that one
         targetView := device activePointerGrab.
+        Transcript showCR:'direct to %1' with:targetView.
     ] ifFalse:[
         (ev isKeyEvent) ifTrue:[
-            "/ if there is a pointer grab, the event has to sent to that one
+            "/ if there is a keyboard grab, the event has to sent to that one
             targetView := device activeKeyboardGrab.
+            Transcript showCR:'direct to %1' with:targetView.
         ].
     ].
     
     targetView isNil ifTrue:[
-        ((0@0 corner:self extent) containsPoint:aPoint) ifTrue:[
+        ((0@0 extent:self extent) containsPoint:aPoint) ifTrue:[
             self subViews do:[:each |
                 |whichView|
 
@@ -7426,8 +7428,11 @@
 
     targetView notNil ifTrue:[
         sensor := targetView sensor.
-
-        pointXLated := device translatePoint:aPoint fromView:self toView:targetView.
+        targetView == self ifTrue:[
+            pointXLated := aPoint
+        ] ifFalse:[
+            pointXLated := device translatePoint:aPoint fromView:self toView:targetView.
+        ].
         ev x:(pointXLated x).
         ev y:(pointXLated y).
         ev view:targetView.
@@ -7436,7 +7441,7 @@
             sensor buttonPress:ev button x:ev x y:ev y view:targetView.
         ] ifFalse:[
             ev isButtonReleaseEvent ifTrue:[
-                sensor buttonRelease:ev button x:ev x y:ev y view:targetView.
+                sensor buttonRelease:ev button x:(ev x) y:(ev y) view:targetView.
             ] ifFalse:[
                 sensor pushEvent:ev.
             ]