On Jul 10, 2005, at 6:14 PM, Scott Palmer wrote:
On 10-Jul-05, at 3:13 AM, Tim Boudreau wrote:
It's compounded a bit by the fact that Apple's implementation of
PopupFactory doesn't seem to get the algorithm for deciding when
to use a heavyweight window quite right - sometimes, apparently
randomly, it will use a heavyweight window even though a
lightweight popup would work just fine.
I think heavyweights are used for two reasons. One to get the
shadow, two to get the translucent effect that pop-ups/menus have
on OS X. I wasn't sure if lightweight pop-ups were ever used.
In an earlier 1.4.2 release on Mac OS, heavyweight popups were
always on - the ivar in PopupFactory was hardcoded to the
heavyweight constant, with a note in the sources about "Steve will
fix this..."; in a later release this was fixed, but lightweight
popups were broken (I had to put a mac-os version-specific hack
into some code in NetBeans that uses PopupFactory to *force* the
popups to be heavyweight). In the latest version, you sometimes
get heavyweight popups, sometimes lightweight popups; it doesn't
seem to be solely determined by whether a lightweight popup could
be used - sometimes you get one, sometimes you don't. I haven't
read the sources for the latest version of PopupFactory, but I'm
guessing it's just reusing a heavyweight popup if it has a recently
used one that hasn't been GC'd or something such.
Anyway, since the drop shadow is provided by the OS for the native
window, my best bet is to implement my own PopupFactory which will
do lightweight popups where possible - that's not hard. But
heavyweight popups will still sometimes be needed - I just need
them without the drop shadow border. I'm not above reflection-
based hacks on the window peer if that's what it takes - it's easy
enough to make them fail gracefully.
Does anyone know a way to turn off the drop shadow for a native
window via Cocoa Java (yes, I know, bad bad bad, don't do that) or
a less egregious client property or something that will do the trick?
-Tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden