WindowGroup.st
changeset 8330 ba43ef540122
parent 8314 3754b8e6f755
child 8331 77fb86b87640
--- a/WindowGroup.st	Thu Mar 29 13:09:05 2018 +0200
+++ b/WindowGroup.st	Wed Apr 11 14:23:04 2018 +0200
@@ -21,8 +21,7 @@
 		postEventHooks creatingProcess traceEvents processPriority
 		inWithCursorDoBlock doNotCloseOnAbortSignal previousFocusView
 		modalGroup'
-	classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal
-		WindowGroupQuerySignal LastEventQuerySignal BusyHookTime'
+	classVariableNames:'LastActiveGroup LastActiveProcess LeaveSignal BusyHookTime'
 	poolDictionaries:''
 	category:'Interface-Support-UI'
 !
@@ -248,24 +247,13 @@
         LeaveSignal nameClass:self message:#leaveSignal.
         LeaveSignal notifierString:'unhandled leave signal'.
 
-        WindowGroupQuerySignal := WindowGroupQuery.
-        LastEventQuerySignal := LastEventQuery.
-
         BusyHookTime := 150.     "ms"
-
-"/        WindowGroupQuerySignal := QuerySignal new.
-"/        WindowGroupQuerySignal nameClass:self message:#windowGroupQuerySignal.
-"/        WindowGroupQuerySignal notifierString:'query for windowgroup'.
-"/
-"/        LastEventQuerySignal := QuerySignal new.
-"/        LastEventQuerySignal nameClass:self message:#lastEventQuerySignal.
-"/        LastEventQuerySignal notifierString:'query for last event'.
     ].
 
     "WindowGroup initialize"
 
     "Modified: / 27-01-2011 / 18:14:34 / cg"
-    "Modified: / 16-03-2018 / 12:28:11 / stefan"
+    "Modified: / 11-04-2018 / 11:24:31 / stefan"
 ! !
 
 !WindowGroup class methodsFor:'instance creation'!
@@ -281,9 +269,10 @@
 lastEventQuerySignal
     "return the signal which is used to query for the last event"
 
-    ^ LastEventQuerySignal
-
-    "Created: 17.7.1996 / 20:36:04 / cg"
+    ^ LastEventQuery
+
+    "Created: / 17-07-1996 / 20:36:04 / cg"
+    "Modified: / 11-04-2018 / 11:20:49 / stefan"
 !
 
 leaveSignal
@@ -298,9 +287,10 @@
 windowGroupQuerySignal
     "return the signal which is used to query for the windowGroup"
 
-    ^ WindowGroupQuerySignal
-
-    "Created: 17.7.1996 / 20:36:04 / cg"
+    ^ WindowGroupQuery
+
+    "Created: / 17-07-1996 / 20:36:04 / cg"
+    "Modified: / 11-04-2018 / 11:23:31 / stefan"
 ! !
 
 !WindowGroup class methodsFor:'accessing'!
@@ -352,8 +342,8 @@
         ]
     ].
 
-    WindowGroupQuerySignal isNil ifTrue:[^ nil]. "/ only during very early init phase
-    wg := WindowGroupQuerySignal query.
+    WindowGroupQuery isNil ifTrue:[^ nil]. "/ only during very early init phase
+    wg := WindowGroupQuery query.
 
     wg isNil ifTrue:[
         "/ mhmh - noone willing to answer that question ...
@@ -378,9 +368,9 @@
      WindowGroup activeGroup 
     "
 
-    "Modified: / 3.9.1995 / 14:49:53 / claus"
-    "Modified: / 17.4.1998 / 11:49:28 / cg"
-    "Modified: / 18.3.1999 / 18:30:33 / stefan"
+    "Modified: / 03-09-1995 / 14:49:53 / claus"
+    "Modified: / 17-04-1998 / 11:49:28 / cg"
+    "Modified: / 11-04-2018 / 11:23:20 / stefan"
 !
 
 activeMainApplication
@@ -1395,8 +1385,8 @@
         signalsToHandle add:AbortOperationRequest
     ].
 
-    WindowGroupQuerySignal answer:self do:[
-        [
+    WindowGroupQuery answer:self do:[
+        [ "/ ... ensure
             |g mainGroup mySema waitSema mainSema groupForSema|
 
             waitSema := mySema := mySensor eventSemaphore.
@@ -1560,7 +1550,7 @@
     ]
 
     "Modified: / 06-07-2010 / 11:47:27 / cg"
-    "Modified (format): / 15-02-2018 / 18:17:03 / stefan"
+    "Modified (comment): / 11-04-2018 / 11:30:52 / stefan"
 !
 
 executePostEventHooksFor:anEvent
@@ -1606,7 +1596,9 @@
 !
 
 lastEvent
-    ^ LastEventQuerySignal query
+    ^ LastEventQuery query
+
+    "Modified: / 11-04-2018 / 11:21:21 / stefan"
 !
 
 leaveEventLoop
@@ -1623,10 +1615,10 @@
      Be warned: this is not a regular (i.e. OK/ESCAPE) the modal box closing."
 
     self isInModalLoop ifTrue:[
-        LeaveSignal isHandled ifTrue:[
-            self process interruptWith:[LeaveSignal raise]
-        ]
+        self process interruptWith:[LeaveSignal isHandled ifTrue:[LeaveSignal raise]]
     ].
+
+    "Modified: / 11-04-2018 / 11:35:30 / stefan"
 !
 
 processEvents
@@ -1647,7 +1639,7 @@
 
     <resource: #keyboard (#Escape )>
 
-    |event busyHookBlock busyHookCalled modalGroupTopViews|
+    |event busyHookBlock busyHookCalled|
 
     self processExposeEvents.
 
@@ -1655,7 +1647,7 @@
         [mySensor notNil
          and:[(event := mySensor nextEvent) notNil]] whileTrue:[
             |ignore focus firstTop evView
-             modalTop modalDelegate keyboardProcessor
+             modalTop modalDelegate modalGroupTopViews keyboardProcessor
              top evReceiver|
 
             ignore := false.
@@ -1871,7 +1863,7 @@
                 ]
             ].
         ] "end while".
-    ] on:LastEventQuerySignal do:[:ex |
+    ] on:LastEventQuery do:[:ex |
         ex proceedWith:event
     ] ensure:[
         busyHookBlock notNil ifTrue:[
@@ -1886,7 +1878,8 @@
 
     "Created: / 05-03-1997 / 11:33:11 / cg"
     "Modified: / 04-08-1998 / 18:18:55 / cg"
-    "Modified: / 16-03-2018 / 12:29:04 / stefan"
+    "Modified: / 11-04-2018 / 11:21:14 / stefan"
+    "Modified (format): / 11-04-2018 / 12:39:34 / stefan"
 !
 
 processExposeEvents
@@ -1902,18 +1895,20 @@
     "process only pending expose events from the damage queue.
      This also handles resize, mapped and unmap events."
 
-    |event view sensor|
-
-    (sensor := mySensor) isNil ifTrue:[^ self].
+    |sensor|
+
+    (sensor := mySensor) isNil ifTrue:[
+        ^ self
+    ].
     (sensor damageCount ~~ 0) ifTrue:[
-        WindowGroupQuerySignal answer:self do:[
+        WindowGroupQuery answer:self do:[
+            |event view|
+
             [(event := sensor nextDamageEventFor:aViewOrNil) notNil] whileTrue:[
                 (views notNil or:[topViews notNil]) ifTrue:[
                     view := event view.
                     (aViewOrNil isNil or:[aViewOrNil == view]) ifTrue:[
-                        LastEventQuerySignal handle:[:ex |
-                            ex proceedWith:event
-                        ] do:[
+                        LastEventQuery answer:event do:[
                             (self executePreEventHooksFor:event) ifFalse:[
                                 "/
                                 "/ if the view is no longer shown (iconified or closed),
@@ -1921,10 +1916,8 @@
                                 "/
                                 "/ could this ever be a non-damage ?
                                 "/
-                                view notNil ifTrue:[
-                                    (view shown or:[event isDamage not]) ifTrue:[
-                                        view dispatchEvent:event withFocusOn:nil delegate:true. 
-                                    ].
+                                (view notNil and:[view shown or:[event isDamage not]]) ifTrue:[
+                                    view dispatchEvent:event withFocusOn:nil delegate:true. 
                                 ].
                             ].
                             self executePostEventHooksFor:event.
@@ -1935,8 +1928,9 @@
         ]
     ]
 
-    "Created: / 3.12.1998 / 14:01:39 / cg"
-    "Modified: / 5.2.1999 / 22:26:44 / cg"
+    "Created: / 03-12-1998 / 14:01:39 / cg"
+    "Modified: / 05-02-1999 / 22:26:44 / cg"
+    "Modified: / 11-04-2018 / 11:22:44 / stefan"
 !
 
 processRealExposeEvents
@@ -1961,18 +1955,20 @@
     (sensor := mySensor) isNil ifTrue:[^ self].
     sensor damageCount == 0 ifTrue:[^ self].
 
-    WindowGroupQuerySignal answer:self do:[
-        |event view|
+    WindowGroupQuery answer:self do:[
+        |event|
 
         [
             "/ event := aView nextDamage.
             event := sensor nextExposeEventFor:someViewOrNil.
-            event isNil ifTrue:[^ self].
+            event isNil ifTrue:[
+                ^ self
+            ].
 
             (views notNil or:[topViews notNil]) ifTrue:[
-                LastEventQuerySignal handle:[:ex |
-                    ex proceedWith:event
-                ] do:[
+                LastEventQuery answer:event do:[
+                    |view|
+
                     (self executePreEventHooksFor:event) ifFalse:[
                         view := event view.
                         "/
@@ -1991,7 +1987,7 @@
 
     "Created: / 02-07-1997 / 14:32:19 / cg"
     "Modified: / 05-04-1998 / 11:35:43 / cg"
-    "Modified (format): / 31-01-2017 / 21:53:29 / stefan"
+    "Modified: / 11-04-2018 / 11:22:52 / stefan"
 !
 
 repairDamage