You are not logged in.
I can not make transparent windows on my arch linux box. Same code works on osx and windows. When I do
System.out.println(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.PERPIXEL_TRANSPARENT));
System.out.println(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT));
System.out.println(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.TRANSLUCENT));
In gnome it prints :
true
true
true
But then when I try to make window transparent :
WindowUtils.setWindowTransparent(transparentWindow, true);
It fails with :
Exception in thread "main" java.lang.IllegalArgumentException: Window GraphicsConfiguration 'X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x20]' does not support transparency
at com.sun.jna.platform.WindowUtils$X11WindowUtils.setWindowTransparent(WindowUtils.java:1408)
at com.sun.jna.platform.WindowUtils.setWindowTransparent(WindowUtils.java:1549)
After some googling I found that I have to have some thing called ARGB set in X11 or something like that, but I do not know where and how to set it. Also, minor problem is that on KDE
System.out.println(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.TRANSLUCENT));
returns false.
Last edited by ssijak (2014-12-11 12:44:26)
Offline
Fixed it with custom JWindow :
public class TransparentWindow extends JWindow {
public TransparentWindow(Window owner) {
this(owner, WindowUtils.getAlphaCompatibleGraphicsConfiguration());
}
private TransparentWindow(Window owner, GraphicsConfiguration graphicsConfiguration) {
super(owner, graphicsConfiguration);
}
....
}
But, how can I make this work under kde and kwin? Under kwin this System.out.println(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.TRANSLUCENT)) prints false As I understood after some googling java checks this variable _NET_WM_WINDOW_OPACITY and kwin does not report it or something. How to fix it?
Last edited by ssijak (2014-12-11 12:43:25)
Offline
Please use code tags for code.
https://ugjka.net
"It is easier to fool people, than to convince them that they've been fooled" ~ Dr. Andrea Love
Offline
It now works on KDE also but it still reports System.out.println(AWTUtilities.isTranslucencySupported(AWTUtilities.Translucency.TRANSLUCENT)) prints false. Strange, but whatever.
Offline