class: StandardSystemView
authorClaus Gittinger <cg@exept.de>
Sun, 15 Feb 2015 17:14:02 +0100
changeset 6772 3a5a27e20524
parent 6771 507db14ee90a
child 6773 2127b803f496
class: StandardSystemView changed: #focusIn kludge-fix for wrong WManager behavior of XQuartz (does not honor the WMTransientFor attribute correctly).
StandardSystemView.st
--- a/StandardSystemView.st	Sun Feb 15 14:57:51 2015 +0100
+++ b/StandardSystemView.st	Sun Feb 15 17:14:02 2015 +0100
@@ -1057,6 +1057,19 @@
     |viewToGetFocus viewUnderMousePointer ms|
 
     windowGroup notNil ifTrue:[
+        "/ a hack for window managers, which do not honor the
+        "/ WMTransientFor attribute (i.e. XQuartz).
+        "/ Thsi flag would prevent a popup (dialog or notification) from being
+        "/ covered by its underlying regular view. But on MAC, it does not.
+        "/ However, focus is coming in, when doing this, so we manually fix this
+        "/ here. Should not hurt on other systems, where the view is already on top.
+        "/ if it does, add some conditional check here (device WMTransientForBroken or similar)
+        "/ You can check for you WM to be correct, by disabling the line below,
+        "/ then click on a smallLint-note icon, to see the smallLint info,
+        "/ then click on the underlying codeView, to raise it.
+        "/ if the smallLint view can be covered, your WM is broken.
+        windowGroup topViews first raise.
+
         "/ I got the focus - tell the current focus-windowgroup
         "/ that its focus is gone elsewhere ...
         "/ 'focusIn ' print. windowGroup process name printCR.
@@ -1066,10 +1079,19 @@
         "/ there are situations where this does not happen;
         "/ I am not sure if that is a WM bug or an ST/X bug, but sometimes (with popups),
         "/ I only get a focus in. Could be a race, when the loosing view is already destroyed,
-        "/ when the focus event arrives.
-        "/ Anyway: it does not matter to take it again...
+        "/ at the time the focus event arrives.
+        "/ Anyway: it should not matter to take it again...
         WindowGroup takeFocusFromDevice:self graphicsDevice.
 
+        windowGroup isInModalLoop ifTrue:[
+            windowGroup allTopViewsDo:[:t |
+                t ~~ self ifTrue:[
+                    t focusIn.
+                    ^ self.
+                ].
+            ]
+        ].
+
         "/ Transcript show:self; show:' focus in '; showCR:windowGroup isInModalLoop.
 
         viewToGetFocus := windowGroup focusView.
@@ -1724,11 +1746,11 @@
 !StandardSystemView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.225 2015-01-12 10:27:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.226 2015-02-15 16:14:02 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.225 2015-01-12 10:27:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.226 2015-02-15 16:14:02 cg Exp $'
 ! !