>>>>> "GW" == Gavin Walker <[EMAIL PROTECTED]> writes:
GW> I have noticed this behaviour also (really annoying when an SVG
GW> script creates a window). Preliminary testing indicates it indeed
GW> only occurs under JDK 1.4. However I don't think the tool tip
GW> changes caused it. I had this problem before we solved the
GW> tooltip problem.
I didn't think our changes caused the problem, I thought that
the fake enter events (which were done before & after the changes)
caused it.
GW> Also if the SVG document does not contain tooltips (so no
GW> ToolTipModifier classes are created) this problem still occurs.
Ahh.
GW> I just took a quick flick through the source code. Thierry
GW> added a change to org/apache/batik/swing/gvt/JGVTComponent.java in
GW> June, essentially grabbing the focus on mouse enter. When I
GW> regressed that file to version 1.27 (before the change) the
GW> problem when away. The default MSWindows behaviour on focus
GW> change is to bring the window to the front. You might want to
GW> talk to Thierry about it.
Thanks for the information, I'll definately call his attention to
it.
GW> On a pedantic note "requestFocus()" is now considered bad form
GW> in Java (according to the Java 1.4 doco at least).
GW> "requestFocusInWindow()" is preferred. When I added this line to
GW> version 1.27 where the requestFocus() was the bug was still fixed.
GW> On the down side the method mostly returned "false", i.e. the
GW> focus request was denied.
It may not matter that much in the cases where it returns false.
It appears that he was just trying to make sure that in most cases the
svg content gets keyboard events rather than the 'URL' widget. There
might be better ways to accomplish this (I don't like taking the focus
when the cursor enters the canvas - it really annoys me when I'm
trying to type in a URL). I suspect we will be better off making sure
the application returns focus to the canvas when appropriate (when the
window first comes up, and when the user hits return in the URL field)
rather than gratuitously grabbing focus (even with
requestFocusInWindow - although that might be a good short term fix).
GW> Oh, line 918 of JGVTComponent.java (in version 1.27) or in the
GW> mouseEntered() method.
Thanks again, this is _very_ useful.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]