$OpenBSD: patch-jdk_src_solaris_classes_sun_awt_X11_XWM_java,v 1.1 2013/02/01 15:34:35 kurt Exp $
--- jdk/src/solaris/classes/sun/awt/X11/XWM.java.orig	Fri Oct 26 14:26:15 2012
+++ jdk/src/solaris/classes/sun/awt/X11/XWM.java	Mon Jan 28 21:48:18 2013
@@ -98,7 +98,8 @@ class XWM implements MWMConstants, XUtilConstants {
         ICE_WM = 10,
         METACITY_WM = 11,
         COMPIZ_WM = 12,
-        LG3D_WM = 13;
+        LG3D_WM = 13,
+        CWM_WM = 14;
     public String toString() {
         switch  (WMID) {
           case NO_WM:
@@ -125,6 +126,8 @@ class XWM implements MWMConstants, XUtilConstants {
               return "Compiz";
           case LG3D_WM:
               return "LookingGlass";
+          case CWM_WM:
+              return "CWM";
           case UNDETERMINED_WM:
           default:
               return "Undetermined WM";
@@ -558,6 +561,10 @@ class XWM implements MWMConstants, XUtilConstants {
         return isNetWMName("LG3D");
     }
 
+    static boolean isCWM() {
+        return isNetWMName("CWM");
+    }
+
     /*
      * Is Metacity running?
      */
@@ -570,7 +577,7 @@ class XWM implements MWMConstants, XUtilConstants {
     }
 
     static boolean isNonReparentingWM() {
-        return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM);
+        return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
     }
 
     /*
@@ -752,6 +759,8 @@ class XWM implements MWMConstants, XUtilConstants {
                 awt_wmgr = XWM.COMPIZ_WM;
             } else if (isLookingGlass()) {
                 awt_wmgr = LG3D_WM;
+            } else if (isCWM()) {
+                awt_wmgr = CWM_WM;
             } else if (doIsIceWM && isIceWM()) {
                 awt_wmgr = XWM.ICE_WM;
             }
