[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Fix for Component.postEvent for top-level components
From: |
Thomas Fitzsimmons |
Subject: |
Re: [cp-patches] Fix for Component.postEvent for top-level components |
Date: |
Fri, 17 Sep 2004 14:21:28 -0400 |
On Thu, 2004-09-16 at 13:04, Dalibor Topic wrote:
> Hi all,
>
> the attched patch fixes postEvent for top-level components, by only
> delegating unhandled events to the parent component in case that a
> parent component exist. It's been reported after Stephane tried out
> Odonata on Kaffe [1].
>
Looks good, please commit.
Thanks,
Tom
> Also attached is a small test case. And the obligatory ChangeLog entry is
>
> 2004-09-16 Dalibor Topic <address@hidden>
>
> * java/awt/Component.java (postEvent):
> Only delegate to parent if a parent exists.
>
> Reported by: Stephane Meslin-Weber <address@hidden>
>
>
> cheers,
> dalibor topic
>
> [1] http://www.kaffe.org/pipermail/kaffe/2004-September/099721.html
>
> ______________________________________________________________________
> Index: java/awt/Component.java
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
> retrieving revision 1.41
> diff -u -r1.41 Component.java
> --- java/awt/Component.java 11 Sep 2004 12:18:06 -0000 1.41
> +++ java/awt/Component.java 16 Sep 2004 17:00:46 -0000
> @@ -2270,7 +2270,7 @@
> {
> boolean handled = handleEvent (e);
>
> - if (!handled)
> + if (!handled && getParent() != null)
> // FIXME: need to translate event coordinates to parent's
> // coordinate space.
> handled = getParent ().postEvent (e);
>
> ______________________________________________________________________
> import java.awt.*;
>
> public class PostEventTopLevel {
>
> public static void main (String [] args) {
>
> Component c = new Button();
> boolean handled = c.postEvent(new Event(null,0,null));
> System.out.println(handled);
>
> }
> }
>
> ______________________________________________________________________
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches