< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XWM.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 608             awtWMNonReparenting = (XToolkit.getEnv("_JAVA_AWT_WM_NONREPARENTING") != null) ? 1 : 0;
 609         }
 610         return (awtWMNonReparenting == 1 || XWM.getWMID() == XWM.COMPIZ_WM
 611                 || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
 612     }
 613 
 614     /*
 615      * Prepare IceWM check.
 616      *
 617      * The only way to detect IceWM, seems to be by setting
 618      * _ICEWM_WINOPTHINT(_ICEWM_WINOPTHINT/8) on root and checking if it
 619      * was immediately deleted by IceWM.
 620      *
 621      * But messing with PropertyNotify here is way too much trouble, so
 622      * approximate the check by setting the property in this function and
 623      * checking if it still exists later on.
 624      *
 625      * Gaa, dirty dances...
 626      */
 627     static final XAtom XA_ICEWM_WINOPTHINT = new XAtom("_ICEWM_WINOPTHINT", false);
 628     static final char opt[] = {
 629         'A','W','T','_','I','C','E','W','M','_','T','E','S','T','\0',
 630         'a','l','l','W','o','r','k','s','p','a','c','e','s','\0',
 631         '0','\0'
 632     };
 633     static boolean prepareIsIceWM() {
 634         /*
 635          * Choose something innocuous: "AWT_ICEWM_TEST allWorkspaces 0".
 636          * IceWM expects "class\0option\0arg\0" with zero bytes as delimiters.
 637          */
 638 
 639         if (!XA_ICEWM_WINOPTHINT.isInterned()) {
 640             if (log.isLoggable(PlatformLogger.Level.FINER)) {
 641                 log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
 642             }
 643             return false;
 644         }
 645 
 646         XToolkit.awtLock();
 647         try {
 648             XErrorHandlerUtil.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());


   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 608             awtWMNonReparenting = (XToolkit.getEnv("_JAVA_AWT_WM_NONREPARENTING") != null) ? 1 : 0;
 609         }
 610         return (awtWMNonReparenting == 1 || XWM.getWMID() == XWM.COMPIZ_WM
 611                 || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
 612     }
 613 
 614     /*
 615      * Prepare IceWM check.
 616      *
 617      * The only way to detect IceWM, seems to be by setting
 618      * _ICEWM_WINOPTHINT(_ICEWM_WINOPTHINT/8) on root and checking if it
 619      * was immediately deleted by IceWM.
 620      *
 621      * But messing with PropertyNotify here is way too much trouble, so
 622      * approximate the check by setting the property in this function and
 623      * checking if it still exists later on.
 624      *
 625      * Gaa, dirty dances...
 626      */
 627     static final XAtom XA_ICEWM_WINOPTHINT = new XAtom("_ICEWM_WINOPTHINT", false);
 628     static final char[] opt = {
 629         'A','W','T','_','I','C','E','W','M','_','T','E','S','T','\0',
 630         'a','l','l','W','o','r','k','s','p','a','c','e','s','\0',
 631         '0','\0'
 632     };
 633     static boolean prepareIsIceWM() {
 634         /*
 635          * Choose something innocuous: "AWT_ICEWM_TEST allWorkspaces 0".
 636          * IceWM expects "class\0option\0arg\0" with zero bytes as delimiters.
 637          */
 638 
 639         if (!XA_ICEWM_WINOPTHINT.isInterned()) {
 640             if (log.isLoggable(PlatformLogger.Level.FINER)) {
 641                 log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
 642             }
 643             return false;
 644         }
 645 
 646         XToolkit.awtLock();
 647         try {
 648             XErrorHandlerUtil.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());


< prev index next >