I am using SWT setAlpha() method on the shell. Transparency works correctly in KDE and GNOME environment i.e. typing in terminal:
java -jar program.jar
but when I am starting my java application on pure X without window manager shell is not transparent and has white background. I use command startx and X execute my ~/.xinitrc script which contains:
cd /home/user
java -jar ./program.jar
Here is the code of method:
public void showTransparentShell() {
transparentShell = new Shell(shell, SWT.NO_TRIM);
transparentShell.setAlpha(120);
transparentShell.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
transparentShell.setBounds(shell.getBounds());
AlphaEffect.fadeOnClose(transparentShell, 900, new ExpoOut(), animationRunner);
transparentShell.open();
AlphaEffect.setAlpha(animationRunner, transparentShell, 160, 900, new ExpoOut(), null, null);
}
I am using swt-3.7-2 and gtk-3.2.0
What is required in Linux for transparency? Which components/libraries/packages must be installed for
"transparency effect" to work?
EDIT: After hours of googling I came across solution, I simply start Kwin before my java program:
kwin&
cd /home/user
java -jar ./program.jar
Only problem is than Kwin is pretty big and has a lot of dependancies. I must run my program on computers with 256 MB RAM, so maybe someone know a bit lighter window manager that support transparency and will work wiht SWT in the same way as Kwin?