#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Mon, 02 May 2016 18:28:34 +0200
changeset 7326 086645312963
parent 7324 8d4d00aa885a
child 7327 c9b7921e8134
#BUGFIX by cg class: WindowSensor changed: #addDamage:view:wakeup: #notifyEventArrival:
WindowSensor.st
--- a/WindowSensor.st	Sat Apr 30 03:44:15 2016 +0000
+++ b/WindowSensor.st	Mon May 02 18:28:34 2016 +0200
@@ -1939,25 +1939,49 @@
     "Modified: / 29-08-2013 / 16:29:32 / cg"
 !
 
-notifyEventArrival:anEvent
+notifyEventArrival:anEventOrNil
     "an event arrived - if there is an eventSemaphore,
      signal it, to wake up any windowGroup process"
 
-    |evView|
-
-    evView := anEvent view.
-    (evView notNil and:[catchExpose includesIdentical:evView]) ifTrue:[
-        "/ don't signal sema, if we are currently waiting for an expose
-        "/ (confirmation of a scroll operation).
-        "/ instead, remember that any event arrived for this view.
-        gotOtherEvent add:evView.
-        ^ self
+    |evView wgProcess|
+
+    anEventOrNil notNil ifTrue:[
+        evView := anEventOrNil view.
+        (evView notNil and:[catchExpose includesIdentical:evView]) ifTrue:[
+            "/ don't signal sema, if we are currently waiting for an expose
+            "/ (confirmation of a scroll operation).
+            "/ instead, remember that any event arrived for this view.
+            gotOtherEvent add:evView.
+            ^ self
+        ].
     ].
-
+    
     eventSemaphore notNil ifTrue:[
         "/ can get along with a single trigger;
         "/ because processEvents will read all events
-        eventSemaphore signalOnce
+        eventSemaphore signalOnce.
+        
+        "/ a little kludge:
+        "/ if this is a mouse-click, AND more than one event is already in the queue
+        "/ AND the windowGroup process is being debugged,
+        "/ then raise the debugger.
+        evView notNil ifTrue:[
+            anEventOrNil isButtonPressEvent ifTrue:[
+                mouseAndKeyboard size > 1 ifTrue:[
+                    evView windowGroup notNil ifTrue:[
+                        (wgProcess := evView windowGroup process) notNil ifTrue:[
+                            wgProcess isDebugged notNil ifTrue:[
+                                DebugView allInstances do:[:dbg |
+                                    dbg inspectedProcess == wgProcess ifTrue:[
+                                        dbg window topView raiseDeiconified
+                                    ].    
+                                ].    
+                            ].    
+                        ].    
+                    ].    
+                ].        
+            ].        
+        ].        
     ]
 
     "Modified: 8.2.1997 / 12:01:48 / cg"
@@ -2056,7 +2080,7 @@
     ].
     didAddNewDamage ifTrue:[
         doWakeup ifTrue:[
-            self notifyEventArrival:aView.
+            self notifyEventArrival:nil.
         ].
     ].