[kaffe] patch to stop kaffe from taking 100% CPU when shift/alt/ctrl/button is held down

Kero van Gelder kero at c86235.upc-c.chello.nl
Sat May 22 18:45:02 PDT 2004


Attached.

wanna keep developing software?
http://swpat.ffii.org/

+--- Kero ----------------------- kero at chello@nl ---+
|  all the meaningless and empty words I spoke      |
|                      Promises -- The Cranberries  |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+
-------------- next part --------------
Index: libraries/javalib/java/awt/AWTEvent.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/AWTEvent.java,v
retrieving revision 1.18
diff -u -r1.18 AWTEvent.java
--- libraries/javalib/java/awt/AWTEvent.java    22 Mar 2004 11:24:34 -0000      1.18
+++ libraries/javalib/java/awt/AWTEvent.java    22 May 2004 20:38:14 -0000
@@ -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: libraries/javalib/java/awt/EventQueue.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/EventQueue.java,v
retrieving revision 1.10
diff -u -r1.10 EventQueue.java
--- libraries/javalib/java/awt/EventQueue.java  14 May 2003 23:20:06 -0000      1.10
+++ libraries/javalib/java/awt/EventQueue.java  22 May 2004 20:38:14 -0000
@@ -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: libraries/javalib/java/awt/KeyEvt.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/KeyEvt.java,v
retrieving revision 1.7
diff -u -r1.7 KeyEvt.java
--- libraries/javalib/java/awt/KeyEvt.java      10 Jan 2003 11:19:23 -0000      1.7
+++ libraries/javalib/java/awt/KeyEvt.java      22 May 2004 20:38:14 -0000
@@ -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: libraries/javalib/java/awt/MouseEvt.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/awt/MouseEvt.java,v
retrieving revision 1.8
diff -u -r1.8 MouseEvt.java
--- libraries/javalib/java/awt/MouseEvt.java    25 Oct 2003 12:52:39 -0000      1.8
+++ libraries/javalib/java/awt/MouseEvt.java    22 May 2004 20:38:15 -0000
@@ -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