changeset 10873:a06c13cb2e45

8058197: AWT fails on generic non-reparenting window managers Reviewed-by: azvegint, serb Contributed-by: Rohit Agrawal <rohit.agrawal.mn@gmail.com>
author azvegint
date Wed, 22 Oct 2014 13:39:33 +0400
parents be34425400ec
children 12ab3aed2ba5 6e6f26621fa2
files src/java.desktop/unix/classes/sun/awt/X11/XWM.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/XWM.java	Wed Oct 22 12:33:28 2014 +0400
+++ b/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);
     }
 
     /*