[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: fix for window focus owner tracking

Kaffe CVS cvs-commits at kaffe.org
Wed Nov 10 03:36:36 PST 2004


PatchSet 5430 
Date: 2004/11/10 11:32:22
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: fix for window focus owner tracking

2004-11-10  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/awt/DefaultKeyboardFocusManager.java:
        Resynced with GNU Classpath.

        2004-11-06  Thomas Fitzsimmons  <fitzsim at redhat.com>

        * java/awt/DefaultKeyboardFocusManager.java (dispatchEvent):
        Track Window focus owner on FOCUS_GAINED events.

Members: 
	ChangeLog:1.2979->1.2980 
	libraries/javalib/java/awt/DefaultKeyboardFocusManager.java:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2979 kaffe/ChangeLog:1.2980
--- kaffe/ChangeLog:1.2979	Wed Nov 10 11:17:20 2004
+++ kaffe/ChangeLog	Wed Nov 10 11:32:22 2004
@@ -4,6 +4,16 @@
 	on little endian arm using fpa
 
 	Reported by: Jari Korva <jpkorva at iki.fi>
+
+2004-11-10  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/javalib/java/awt/DefaultKeyboardFocusManager.java:
+	Resynced with GNU Classpath.
+
+	2004-11-06  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * java/awt/DefaultKeyboardFocusManager.java (dispatchEvent):
+        Track Window focus owner on FOCUS_GAINED events.
 	
 2004-11-10  Dalibor Topic  <robilad at kaffe.org>
 
Index: kaffe/libraries/javalib/java/awt/DefaultKeyboardFocusManager.java
diff -u kaffe/libraries/javalib/java/awt/DefaultKeyboardFocusManager.java:1.6 kaffe/libraries/javalib/java/awt/DefaultKeyboardFocusManager.java:1.7
--- kaffe/libraries/javalib/java/awt/DefaultKeyboardFocusManager.java:1.6	Mon Oct  4 09:01:29 2004
+++ kaffe/libraries/javalib/java/awt/DefaultKeyboardFocusManager.java	Wed Nov 10 11:32:26 2004
@@ -171,18 +171,15 @@
 
         if (e.id == FocusEvent.FOCUS_GAINED)
           {
-            if (((FocusEvent) e).isTemporary ())
-              setGlobalFocusOwner (target);
-            else
-              setGlobalPermanentFocusOwner (target);
-          }
-        else if (e.id == FocusEvent.FOCUS_LOST)
-          {
-            // We need to set the window's focus owner here; we can't
-            // set it when the window loses focus because by that time
-            // the previous focus owner has already lost focus
-            // (FOCUS_LOST events are delivered before
-            // WINDOW_LOST_FOCUS events).
+            if (! (target instanceof Window))
+              {
+                if (((FocusEvent) e).isTemporary ())
+                  setGlobalFocusOwner (target);
+                else
+                  setGlobalPermanentFocusOwner (target);
+              }
+
+            // Keep track of this window's focus owner.
 
             // Find the target Component's top-level ancestor.
             Container parent = target.getParent ();
@@ -195,9 +192,12 @@
               (Window) target : (Window) parent;
 
             Component focusOwner = getFocusOwner ();
-            if (focusOwner != null)
+            if (focusOwner != null
+                && ! (focusOwner instanceof Window))
               toplevel.setFocusOwner (focusOwner);
-
+          }
+        else if (e.id == FocusEvent.FOCUS_LOST)
+          {
             if (((FocusEvent) e).isTemporary ())
               setGlobalFocusOwner (null);
             else




More information about the kaffe mailing list