AWT falls in infinite loop

U verdier philippe verdier at ditv-philips.fr
Fri Aug 14 02:05:57 PDT 1998


> From relay1!rufus.w3.org!kaffe  Fri Aug 14 06:14:11 1998
> >Received: from relay5.eunet.fr by relay1.fnet.fr (5.65c8d/96.05.03)
> 	via EUnet-France id AA10892; Thu, 13 Aug 1998 21:09:02 +0200 (MET)
> Resent-From: kaffe at rufus.w3.org
> Resent-Date: Thu, 13 Aug 1998 15:05:42 -0400
> Resent-Message-Id: <199808131905.PAA31647 at rufus.w3.org>
> X-Authentication-Warning: rufus.w3.org: majordom set sender to owner-kaffe at rufus.w3.org using -f
> From: "Peter C. Mehlitz" <peter at transvirtual.com>
> To: kaffe at rufus.w3.org
> Subject: Re: AWT falls in infinite loop
> Date: Thu, 13 Aug 1998 18:33:00 +0200
> Mime-Version: 1.0
> Content-Transfer-Encoding: 8bit
> X-Loop: kaffe at rufus.w3.org
> X-Mailing-List: kaffe at rufus.w3.org
> 
> On Thu, 13 Aug 1998, (U wrote:
> >
> >    EventDispatchThread.run
> >----->  MouseEvent.dispatch
> >|   ->    AWTEvent.transferMouse
> >|   ->      DocContainer.processMouseEvent
> >|
> >|   DocContainer is the component called 'to' (a 'transferMouse'
> >|   method parameter). It is a component of the ICE browser which
> >|   has a mouse listener. At this time, the 'DocContainer.processMouseEvent'
> >|   method calls 'Component.processMouseEvent' which itself calls
> >|   the component mouse listener (which does nothing). Then, the
> >|   'Component.processEvent' method is called:
> >|
> >|   ->        Component.processEvent
> >|   ->          MouseEvent.dispatch ----
> >|                                      |
> >----------------------------------------
> >
> 
> Peter C. Mehlitz:
> How is this supposed to work, if DocContainer.processMouseEvent() calls
> Component.processEvent(), which should - according to the specs - call again
> processMouseEvent() ? Why does it do so at all (since processEvent seems to be
> the event type dispatcher in JDK)?

More precisely:

    EventDispatchThread.run
----->  MouseEvent.dispatch
|   ->    AWTEvent.transferMouse
|   ->      DocContainer.processMouseEvent
|
|   DocContainer is the component called 'to' (a 'transferMouse'
|   method parameter). It is a component of the ICE browser which
|   has a mouse listener. At this time, the 'DocContainer.processMouseEvent'
|   method calls 'Component.processMouseEvent' which itself calls
|   the component mouse listener (which does nothing). Then, the
|   'super.processEvent' method is called on an instance of class
|   'Browser'. And the 'processEvent' method is implemented in 'Component'.
|
|   ->        Component.processEvent ('Browser.processEvent' not defined)
|   ->          MouseEvent.dispatch ----
|                                      |
----------------------------------------

With JDK-1.1.5, the calls stack is the following:

  EventDispatchThread.run
  ->  Component.dispatchEvent
  ->    Component.dispatchEventImpl
  ->      Component.processEvent ('DocContainer.processEvent' not defined)
  ->        DocContainer.processMouseEvent

  At this time, the 'DocContainer.processMouseEvent'
  method calls 'Component.processMouseEvent' which itself calls
  the component mouse listener (which does nothing). Then, the
  'super.processEvent (= Component.processEvent)' method is called on
  'Browser'.

  ->          Component.processEvent ('Browser.processEvent' not defined)
  ->            Component.processMouseEvent
                END (no listener defined for 'Browser')

> Since processEvent() is protected, it can be called from all derived classes
> (outside of java.awt), for any event (i.e. not just for the ones obtained via
> EventQueue.getNextEvent() / dispatched via EvenetDispatchThread()). According
> to the specs, processEvent() has to call the process<EventType>Event() method.
> 
> Wait a second - isn't the ICE web-browser based on swing? This would explain a
> lot..

The ICE web-browser is not based on Swing and Kaffe-AWT is according to the specs.
BUT in 'Component.processEvent' the mouse event seems to be dispatched whatever
the object ('this') which has to handle the event. Perhaps 'event.source' has to be
changed with regards to 'this' ?



More information about the kaffe mailing list