WinWorkstation.st
changeset 6590 fbca4476f22c
parent 6565 a3955bc42356
child 6601 b8861e87960d
--- a/WinWorkstation.st	Fri Nov 14 00:49:23 2014 +0100
+++ b/WinWorkstation.st	Fri Nov 14 12:31:43 2014 +0100
@@ -11414,21 +11414,30 @@
 mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
     "the mousewheel event as delivered by win32 has a bug:
      the view passed here is always the topView - not the view under the pointer.
-     For compatibility with unix, we figure out the view here and pass that one down."
-
-    |focusView|
+     For compatibility with unix, we figure out the view here from the pointer position
+     and pass that one down (used to be the focus view, but that is inconvenient)."
+
+    |wg screenPoint targetView|
 
     aView isNil ifTrue:[
-	"/ event arrived, after I destroyed it myself
-	^ self
-    ].
-
-    aView windowGroup notNil ifTrue:[
-	focusView := aView windowGroup focusView.
-    ].
+        "/ event arrived, after I destroyed it myself
+        ^ self
+    ].
+
+    UserPreferences current mouseWheelFocusFollowsMouse ifTrue:[
+        screenPoint := self translatePointToRoot:(x@y) fromView:aView.
+        targetView := self viewFromPoint:screenPoint.
+    ].
+
+    (targetView isNil) ifTrue:[
+        (wg := aView windowGroup) notNil ifTrue:[
+            targetView := wg focusView.
+        ].
+    ].
+
     aView sensor
-	mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
-	view:(focusView ? aView)
+        mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
+        view:(targetView ? aView)
 
     "Modified: / 21.5.1999 / 13:05:53 / cg"
 !
@@ -17490,7 +17499,7 @@
     "/ we might try activate2 there.
 
     "/ self activateWindow1:aWindowId
-    self activateWindow2:aWindowId
+    self activateWindow2:aWindowId.
 !
 
 animateWindow:aWindowId show:doShow animation:animationSymbolorNil time:timeInMillisOrNil
@@ -19352,11 +19361,11 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.485 2014-08-28 15:14:38 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.486 2014-11-14 11:31:43 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.485 2014-08-28 15:14:38 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.486 2014-11-14 11:31:43 cg Exp $'
 ! !