8058197: AWT fails on generic non-reparenting window managers
Reviewed-by: azvegint, serb
Contributed-by: Rohit Agrawal <rohit.agrawal.mn@gmail.com>
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java Wed Oct 22 12:33:28 2014 +0400
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java Wed Oct 22 13:39:33 2014 +0400
@@ -595,8 +595,13 @@
return isNetWMName("Mutter") || isNetWMName("GNOME Shell");
}
+ static int awtWMNonReparenting = -1;
static boolean isNonReparentingWM() {
- return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
+ if (awtWMNonReparenting == -1) {
+ awtWMNonReparenting = (XToolkit.getEnv("_JAVA_AWT_WM_NONREPARENTING") != null) ? 1 : 0;
+ }
+ return (awtWMNonReparenting == 1 || XWM.getWMID() == XWM.COMPIZ_WM
+ || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
}
/*