8058197: AWT fails on generic non-reparenting window managers
authorazvegint
Wed, 22 Oct 2014 13:39:33 +0400
changeset 27284 98699328cef3
parent 27283 99c4cb470573
child 27285 1b4ca1c84d23
child 27500 d291fa015bf9
8058197: AWT fails on generic non-reparenting window managers Reviewed-by: azvegint, serb Contributed-by: Rohit Agrawal <rohit.agrawal.mn@gmail.com>
jdk/src/java.desktop/unix/classes/sun/awt/X11/XWM.java
--- 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);
     }
 
     /*