Re: [Java-gnome-developer] Transparent Window
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2010-02-18 23:57:44
|
On Thu, 2010-02-18 at 19:33 -0300, Rafael Arcanjo wrote: > > Well I used the command AWTUtilities.setWindowOpacity (this, 0.5) and > gave as incompatible types. You can't mix toolkits. Two different libraries both trying to drive GTK will confuse the X server and crash your Java VM. If you're using java-gnome (and of course we hope you do!) to build the user interface layer for your application, then its native coverage of the GTK toolkit is all you need to use. > is there any way to get the transparent window? Yes... Transparency is a somewhat advanced topic; we don't tend to need it much in GNOME (and people are discouraged from trying to make fancy shaped windows that ignore the window manager). Coverage in java-gnome has been prototyped but is still experimental and not yet accepted for merging to 'mainline'. If you want to try it you'll need to learn how to build java-gnome from Bazaar. If the branch works for you, then perhaps you will consider helping us improve it to the point where it can be accepted into the next release. There are two parts: 1. Set backing pixmap to transparent: screen = w.getScreen(); colormap = screen.getColormapRGBA(); w.setColormap(colormap); w.realize(); underlying = w.getWindow(); underlying.setBackingPixmap(null, false); 2. Clear to background in Widget.ExposeEvent: cr.setSource(1.0, 1.0, 1.0, 1.0); cr.setOperator(Operator.CLEAR); cr.paint(); but as I said, it's still experimental and that API is not in a released version of the library, nor in 'mainline'. If you want to work on it, my branch is at 'hackers/andrew/cairo-transparency'. Come and chat with us in #java-gnome on irc.gimp.net and we can explore it further. Otherwise, at the moment, > is there any way to get the transparent window? > No, sorry. AfC Sydney |