[kaffe] CVS kaffe (dalibor): Stop kaffe from taking 100% CPU when shift/alt/ctrl/button is held down

Kaffe CVS cvs-commits at kaffe.org
Sun May 23 08:42:02 PDT 2004


PatchSet 4772 
Date: 2004/05/23 15:16:07
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Stop kaffe from taking 100% CPU when shift/alt/ctrl/button is held down

2004-05-23  Kero van Gelder <kero at d4050.upc-d.chello.nl>

        * libraries/javalib/java/awt/AWTEvent.java:
        (accelHint) Removed.
        * libraries/javalib/java/awt/EventQueue.java:
        (getNextEvent) Remove check for accelHint.
        * libraries/javalib/java/awt/KeyEvt.java,
        libraries/javalib/java/awt/MouseEvt.java:
        (dispatch) Removed handling of accelHint.

Members: 
	ChangeLog:1.2343->1.2344 
	libraries/javalib/java/awt/AWTEvent.java:1.18->1.19 
	libraries/javalib/java/awt/EventQueue.java:1.10->1.11 
	libraries/javalib/java/awt/KeyEvt.java:1.7->1.8 
	libraries/javalib/java/awt/MouseEvt.java:1.8->1.9 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2343 kaffe/ChangeLog:1.2344
--- kaffe/ChangeLog:1.2343	Sun May 23 13:23:27 2004
+++ kaffe/ChangeLog	Sun May 23 15:16:07 2004
@@ -1,3 +1,13 @@
+2004-05-23  Kero van Gelder <kero at d4050.upc-d.chello.nl>
+
+        * libraries/javalib/java/awt/AWTEvent.java:
+	(accelHint) Removed.
+        * libraries/javalib/java/awt/EventQueue.java:
+	(getNextEvent) Remove check for accelHint.
+        * libraries/javalib/java/awt/KeyEvt.java,
+        libraries/javalib/java/awt/MouseEvt.java:
+	(dispatch) Removed handling of accelHint.
+
 2004-05-23  Dalibor Topic  <robilad at kaffe.org>
 
         * libraries/javalib/profiles/default/coreawt.files,
Index: kaffe/libraries/javalib/java/awt/AWTEvent.java
diff -u kaffe/libraries/javalib/java/awt/AWTEvent.java:1.18 kaffe/libraries/javalib/java/awt/AWTEvent.java:1.19
--- kaffe/libraries/javalib/java/awt/AWTEvent.java:1.18	Mon Mar 22 11:24:34 2004
+++ kaffe/libraries/javalib/java/awt/AWTEvent.java	Sun May 23 15:16:09 2004
@@ -44,7 +44,6 @@
 	static Window activeWindow;
 	static Component mouseTgt;
 	protected static int inputModifier;
-	protected static boolean accelHint;
 	protected static Component[] sources;
 	private static int nSources;
 	protected static Object evtLock = new Object();
Index: kaffe/libraries/javalib/java/awt/EventQueue.java
diff -u kaffe/libraries/javalib/java/awt/EventQueue.java:1.10 kaffe/libraries/javalib/java/awt/EventQueue.java:1.11
--- kaffe/libraries/javalib/java/awt/EventQueue.java:1.10	Wed May 14 23:20:06 2003
+++ kaffe/libraries/javalib/java/awt/EventQueue.java	Sun May 23 15:16:09 2004
@@ -178,9 +178,7 @@
 			// we don't have to check Toolkit.IS_BLOCKING here, since we reach
 			// this point only in case it is not blocked, or evtGetNextEvent()
 			// returned 'null'
-			if ( !AWTEvent.accelHint ) {
-				Thread.sleep( Defaults.EventPollingRate);
-			}
+			Thread.sleep( Defaults.EventPollingRate);
 		}
 	}
 }
Index: kaffe/libraries/javalib/java/awt/KeyEvt.java
diff -u kaffe/libraries/javalib/java/awt/KeyEvt.java:1.7 kaffe/libraries/javalib/java/awt/KeyEvt.java:1.8
--- kaffe/libraries/javalib/java/awt/KeyEvt.java:1.7	Fri Jan 10 11:19:23 2003
+++ kaffe/libraries/javalib/java/awt/KeyEvt.java	Sun May 23 15:16:09 2004
@@ -21,7 +21,6 @@
 	}
 
 	if ( id == KEY_PRESSED ) {
-		accelHint = true;
 		if ( keyChar == 0 ){
 			// update modifiers for function keys
 			switch ( keyCode ) {
@@ -47,8 +46,6 @@
 		}	
 	}
 	else if ( id == KEY_RELEASED ) {	
-		accelHint = false;
-
 		if ( (AWTEvent.keyTgt.eventMask & AWTEvent.DISABLED_MASK) == 0 ) {
 			AWTEvent.keyTgt.process( this);
 		}
Index: kaffe/libraries/javalib/java/awt/MouseEvt.java
diff -u kaffe/libraries/javalib/java/awt/MouseEvt.java:1.8 kaffe/libraries/javalib/java/awt/MouseEvt.java:1.9
--- kaffe/libraries/javalib/java/awt/MouseEvt.java:1.8	Sat Oct 25 12:52:39 2003
+++ kaffe/libraries/javalib/java/awt/MouseEvt.java	Sun May 23 15:16:09 2004
@@ -190,7 +190,6 @@
 			else
 				clicks = 1;
 
-			accelHint = true;
 			clickCount = clicks;
 			lastPressed = when;
 
@@ -201,7 +200,6 @@
 		  break;
 		
 		case MOUSE_RELEASED:
-			accelHint = false;
 			clickCount = clicks;
 			buttonPressed = false;
 




More information about the kaffe mailing list