Patch: Fix endless loop because FocusEvents were processed in the wrong order
Roman Kennke
roman at kennke.org
Thu Jan 5 12:40:02 PST 2012
Hi Ralf,
Nice to hear from you!
The patch (and the other one you sent) seem to be fine. I will test it
(we have a bunch of things that we need to verify don't break) and
integrate it asap.
I have a little request: There are a couple of things in the code that I
know we keep bouncing back and forth and I feel we never really get to a
real solution. Both the focus and visibility I remember we have already
changed a couple of times, mostly based on experimenting and single
(ofter corner) cases that make problems. I really would like to see some
little testing for this code, ideally a unit test the shows how the code
breaks, and which the patch resolves. This way we avoid that in some
future changes we do something that breaks your patch again.
The big question of course is how to test it. Especially when something
is only exposed on particular platforms. The testing backend (which only
draws to BufferedImage and generates events by means of java.awt.Robot)
might be very useful here. Maybe you can think about a test that shows
the problem, using this testing backend (tta)? You would make me very
happy, and ensure the same problem doesn't happen in the future (i.e.
make you happy!).
Cheers, Roman
Am Mittwoch, den 04.01.2012, 16:46 +0100 schrieb Ralf Heini:
> This issue came up using a JDialog on Windows.
>
> Unterschiede zwischen Dateien-Anlage (fix-focus-event-loop.patch)
> diff -r 5601f95ef66a cacio-shared/src/main/java/sun/awt/peer/cacio/CacioWindowPeer.java
> --- a/cacio-shared/src/main/java/sun/awt/peer/cacio/CacioWindowPeer.java Fri Dec 30 17:09:13 2011 +0100
> +++ b/cacio-shared/src/main/java/sun/awt/peer/cacio/CacioWindowPeer.java Wed Jan 04 16:41:38 2012 +0100
> @@ -226,10 +226,10 @@
> {
> // Simulate what the native system thinks is the currently focused window.
> CacioKeyboardFocusManagerPeer.getInstance().setCurrentFocusedWindow(w);
> + super.handlePeerEvent(ev);
> WindowEvent we =
> new WindowEvent(w, WindowEvent.WINDOW_GAINED_FOCUS);
> super.handlePeerEvent(we);
> - super.handlePeerEvent(ev);
> }
> break;
> case FocusEvent.FOCUS_LOST:
More information about the caciocavallo-dev
mailing list