StandardSystemView.st
changeset 6721 63e784a23e49
parent 6646 7eb10d85e589
child 6741 c74272178933
--- a/StandardSystemView.st	Tue Jan 06 12:49:20 2015 +0100
+++ b/StandardSystemView.st	Tue Jan 06 13:10:57 2015 +0100
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libview' }"
 
+"{ NameSpace: Smalltalk }"
+
 TopView subclass:#StandardSystemView
 	instanceVariableNames:'label icon iconView iconLabel minExtent maxExtent sizeFixed
 		application windowEventsForApplication deviceIcon labelChannel'
@@ -1052,7 +1054,7 @@
      I.e. the mouse was moved out into the topView area - restore the
      focus to the previous focusView.."
 
-    |v ms|
+    |viewToGetFocus viewUnderMousePointer ms|
 
     windowGroup notNil ifTrue:[
         "/ I got the focus - tell the current focus-windowgroup
@@ -1070,27 +1072,25 @@
 
         "/ Transcript show:self; show:' focus in '; showCR:windowGroup isInModalLoop.
 
-        v := windowGroup focusView.
-        v isNil ifTrue:[
+        viewToGetFocus := windowGroup focusView.
+        viewToGetFocus isNil ifTrue:[
             UserPreferences current focusFollowsMouse ~~ false ifTrue:[
-                v := windowGroup pointerView.
-                "/ 'pointerView is ' print. v printCR.
-                (v notNil
-                and:[v isKeyboardConsumer not
-                and:[v wantsFocusWithPointerEnter not]]) ifTrue:[
-                    "/ no - not this one
-                    "/ 'not a kbdConsumer' printCR.
-                    v := nil.
+                viewUnderMousePointer := windowGroup pointerView.
+                "/ 'viewUnderMousePointer is ' print. viewUnderMousePointer printCR.
+                (viewUnderMousePointer notNil
+                and:[viewUnderMousePointer isKeyboardConsumer
+                and:[viewUnderMousePointer wantsFocusWithPointerEnter]]) ifTrue:[
+                    viewToGetFocus := viewUnderMousePointer.
                 ]
-            ]
+            ].
         ].
-        v isNil ifTrue:[
+        viewToGetFocus isNil ifTrue:[
             self assignInitialKeyboardFocus.
         ] ifFalse:[
             "/ v requestFocus.  - will be denied; but we must force it here
             "/ to force a change...
             windowGroup setFocusView:nil.
-            windowGroup focusView:v byTab:nil.
+            windowGroup focusView:viewToGetFocus byTab:nil.
         ].
 
         "/ optionally bring the window to the front after some delay.
@@ -1721,11 +1721,11 @@
 !StandardSystemView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.223 2014-12-03 14:40:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.224 2015-01-06 12:10:57 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.223 2014-12-03 14:40:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.224 2015-01-06 12:10:57 cg Exp $'
 ! !