<AWT Dev> hg: jdk7/awt/jdk: 6708392: Provide internal API to create OverrideRedirect windows, XToolkit

Artem Ananiev Artem.Ananiev at Sun.COM
Fri Aug 15 00:16:16 PDT 2008


Hi, Mark,

my comments are inline.

Mark Wielaard wrote:
> Hi Artem,
> 
> On Thu, 2008-08-14 at 09:01 +0000, artem.ananiev at sun.com wrote:
>> Changeset: 99658a8d42fa
>> Author:    art
>> Date:      2008-08-14 12:58 +0400
>> URL:       http://hg.openjdk.java.net/jdk7/awt/jdk/rev/99658a8d42fa
>>
>> 6708392: Provide internal API to create OverrideRedirect windows, XToolkit
>> Summary: SunToolkit.setOverrideRedirect() method is introduced
>> Reviewed-by: mlapshin, yan
> 
> This looks like a different way to fix the issue I reported back in May
> for bug #6695441.  I didn't see the review on the list and unfortunately
> the bug referenced #6708392 isn't available. So some questions about
> this solution.
> 
> - The original used the solution of having the window name set to a
> special value. Although slightly hacky, this would in general work with
> any Toolkit that understood this hint. And it would prevent having to
> keep another cache.

You have already answered the question: using Component's name to 
specify an OverrideRedirect attribute is a hack. Do you think it is fine 
to have such cross-toolkit hacks in our code?

> - Why keep a weak cache for this hint? Why not add a property to Window
> or WindowPeer?

See below.

> - You add this to the generic SunToolkit class, but it seems specific to
> the XToolkit. It might be better to rename this property from
> OverrideRedirect to something X11/ICCCM specific. Maybe call it
> isPopupWindow? Then it is clear why some windows might have this hint
> set for their (swing) popups and then other toolkits/window/display
> managers could act appropriately.

The answer for both questions is: java.awt.* classes should only expose 
functionality available on all the supported platforms. Otherwise (like 
in this case with OverrideRedirect hint), sun.awt.* packages are used. 
If we later find a Win32 hint which corresponds to X11 OverrideRedirect, 
we'll move the code from sun.awt.* to java.awt.* and/or make it public.

I understand the current solution is not ideal, however it is still 
better than having all the windows OverrideRedirect or a new method in 
Window class.

Thanks,

Artem

> Thanks,
> 
> Mark




More information about the jdk7-changes mailing list