Wednesday, June 27, 2007

Improved Window Shaping

Thanks to contributions from Olivier Chafik and Chris Deckers, the overhead for setting a window shape mask has been reduced by about two orders of magnitude. In this case, the balloon tip windows no longer have such a noticeable delay before showing.

Linux users should also have fewer issues with this version; some of the library setup previously required is now taken care of automatically by the JNA library.



6 comments:

Anonymous said...

I'm having a problem where the JFrame decorations disappear when I make the window transparent. They're still there in that they take up space, but you can't see them or click on them. I realize this is not something most people want, but for my particular app I need a regular window with a transparent hole. BTW, the hole part works, thanks for making that easy. Any ideas on the decorations?

Rob

technomage said...

In this implementation, once you make the window transparent, you become responsible for painting all of the window's contents, including the title bar. One way to do that would be to paint a similarly-sized JInternalFrame into a buffer, then copy its title bar area.

What platform are you on?

It may be easier to make the hole by setting the window mask instead of setting the background transparent. You don't get antialiased edges, but that may not matter.

Christophe said...

hello,

I'm trying to build a webstart demo which use JNA for transparency (see http://swing-fx.blogspot.com/2008/08/sexy-desktop-application-part-2.html ).

I'm using more or less the same JNLP file as you (see http://lebesnec.free.fr/ilist.jnlp ) but I still have an exception :

java.security.AccessControlException: access denied (java.util.PropertyPermission w32.ascii read)

Do you have an idea of what is the problem ?

Thx for your help!

technomage said...

You need to sign your application's jar file(s) using the jarsigner tool.

Christophe said...

yes, my JAR are all signed, but I still have this error ...

technomage said...

I tried your jnlp link and the application launched (although there was no transparency or window shaping).