WindowSensor.st
changeset 751 043bbbd431e6
parent 743 64c9b71b3cc4
child 1012 e408830caf2d
--- a/WindowSensor.st	Tue May 28 21:49:00 1996 +0200
+++ b/WindowSensor.st	Tue May 28 21:54:08 1996 +0200
@@ -749,12 +749,12 @@
     "an expose event arrived - this is sent from the device (Display)"
 
     ignoreExposeEvents ~~ true ifTrue:[
-        (self addDamage:(Rectangle left:left top:top width:width height:height) view:aView) ifTrue:[
-            self notifyEventArrival
-        ]
+        self addDamage:(Rectangle left:left top:top width:width height:height) 
+                  view:aView
+                wakeup:true
     ]
 
-    "Modified: 21.5.1996 / 18:21:01 / cg"
+    "Modified: 28.5.1996 / 21:51:35 / cg"
 !
 
 focusInView:aView
@@ -780,7 +780,9 @@
 graphicExposeX:left y:top width:width height:height view:aView
     "a graphic expose event arrived - this is sent from the device (Display)"
 
-    self addDamage:(left @ top extent:width @ height) view:aView.
+    self addDamage:(left @ top extent:width @ height) view:aView wakeup:false.
+
+    "Modified: 28.5.1996 / 21:51:42 / cg"
 !
 
 keyPress:key x:x y:y view:aView
@@ -1157,6 +1159,20 @@
      Except for special cases (moveOpaque of a view over one of my views),
      these optimizations are not noticable."
 
+    ^ self addDamage:aRectangle view:aView wakeup:true
+
+    "Modified: 28.5.1996 / 21:52:47 / cg"
+!
+
+addDamage:aRectangle view:aView wakeup:doWakeup
+    "Add aRectangle to the damage list.
+     Try to merge incoming rectangles with the existing damage rectangles.
+     Incoming rectangles which are completely contained in any existing damage rect are ignored,
+     any existing damage rectangle which is completely contained in the incoming rectangle
+     is replaced. Also, rectangles are merged into bigger ones, if they join exactly.
+     Except for special cases (moveOpaque of a view over one of my views),
+     these optimizations are not noticable."
+
     |temp index newEvent r rL rT rB rR
      count             "{ Class: SmallInteger }" 
      sz                "{ Class: SmallInteger }" 
@@ -1293,9 +1309,14 @@
 
     newEvent := WindowEvent damageFor:aView rectangle:r.
     damage add:newEvent.
+
+    doWakeup ifTrue:[
+        self notifyEventArrival
+    ].
     ^ true
 
     "Modified: 22.5.1996 / 01:24:56 / cg"
+    "Created: 28.5.1996 / 21:51:16 / cg"
 !
 
 damage
@@ -1871,6 +1892,6 @@
 !WindowSensor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.57 1996-05-28 18:28:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.58 1996-05-28 19:53:26 cg Exp $'
 ! !
 WindowSensor initialize!