src/solaris/classes/sun/awt/X11/XWM.java

Print this page

        

@@ -146,11 +146,13 @@
     static final Insets defaultInsets = new Insets(25, 5, 5, 5);
 
     XWM(int WMID) {
         this.WMID = WMID;
         initializeProtocols();
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Window manager: " + toString());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Window manager: " + toString());
+        }
     }
     int getID() {
         return WMID;
     }
 

@@ -250,11 +252,11 @@
             /*
              * Use NO_WM since in all other aspects eXcursion is like not
              * having a window manager running. I.e. it does not reparent
              * top level shells.
              */
-            if (insLog.isLoggable(PlatformLogger.FINE)) {
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
                 insLog.finer("eXcursion means NO_WM");
             }
             return true;
         }
 

@@ -268,11 +270,11 @@
             final String selection_name = "WM_S" + default_screen_number;
 
             long selection_owner =
                 XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(),
                                                XAtom.get(selection_name).getAtom());
-            if (insLog.isLoggable(PlatformLogger.FINE)) {
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
                 insLog.finer("selection owner of " + selection_name
                              + " is " + selection_owner);
             }
 
             if (selection_owner != XConstants.None) {

@@ -297,11 +299,11 @@
                 substruct.set_event_mask(0);
                 XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
                                                     XToolkit.getDefaultRootWindow(),
                                                     XConstants.CWEventMask,
                                                     substruct.pData);
-                if (insLog.isLoggable(PlatformLogger.FINE)) {
+                if (insLog.isLoggable(PlatformLogger.FINER)) {
                     insLog.finer("It looks like there is no WM thus NO_WM");
                 }
             }
 
             return !winmgr_running;

@@ -341,22 +343,30 @@
 
             // Convert data to String, ASCII
             byte[] bytes = XlibWrapper.getStringBytes(getter.getData());
             String id = new String(bytes);
 
+            if (log.isLoggable(PlatformLogger.FINER)) {
             log.finer("ENLIGHTENMENT_COMMS is " + id);
+            }
 
             // Parse WINID
             Pattern winIdPat = Pattern.compile("WINID\\s+(\\p{XDigit}{0,8})");
             try {
                 Matcher match = winIdPat.matcher(id);
                 if (match.matches()) {
+                    if (log.isLoggable(PlatformLogger.FINEST)) {
                     log.finest("Match group count: " + match.groupCount());
+                    }
                     String longId = match.group(1);
+                    if (log.isLoggable(PlatformLogger.FINEST)) {
                     log.finest("Match group 1 " + longId);
+                    }
                     long winid = Long.parseLong(longId, 16);
+                    if (log.isLoggable(PlatformLogger.FINER)) {
                     log.finer("Enlightenment communication window " + winid);
+                    }
                     return winid;
                 } else {
                     log.finer("ENLIGHTENMENT_COMMS has wrong format");
                     return 0;
                 }

@@ -652,11 +662,13 @@
                                      XA_ICEWM_WINOPTHINT, 0, 0xFFFF,
                                      true, XA_ICEWM_WINOPTHINT);
         try {
             int status = getter.execute();
             boolean res = (status == XConstants.Success && getter.getActualType() != 0);
+            if (log.isLoggable(PlatformLogger.FINER)) {
             log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
+            }
             return !res || isNetWMName("IceWM");
         } finally {
             getter.dispose();
         }
     }

@@ -814,11 +826,13 @@
             if ((hints.get_flags() & mask) == 0) {
                 return;
             }
 
             hints.set_flags(hints.get_flags() & ~mask);
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
+            }
             XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(),
                                           window.getWindow(),
                                           hints.pData);
         } finally {
             XToolkit.awtUnlock();

@@ -871,11 +885,13 @@
             return;
         }
 
         XAtomList decorDel = new XAtomList();
         decorations = normalizeMotifDecor(decorations);
-        if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
+        }
         if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
             decorDel.add(XA_OL_DECOR_HEADER);
         }
         if ((decorations & (MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE)) == 0) {
             decorDel.add(XA_OL_DECOR_RESIZE);

@@ -888,11 +904,13 @@
         }
         if (decorDel.size() == 0) {
             insLog.finer("Deleting OL_DECOR");
             XA_OL_DECOR_DEL.DeleteProperty(window);
         } else {
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + decorDel);
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Setting OL_DECOR to " + decorDel);
+            }
             XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel);
         }
     }
 
     /*

@@ -916,11 +934,13 @@
                         MWMConstants.MWM_HINTS_FUNCTIONS |
                         MWMConstants.MWM_HINTS_DECORATIONS);
         hints.set_functions(functions);
         hints.set_decorations(decorations);
 
-        if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("Setting MWM_HINTS to " + hints);
+        if (stateLog.isLoggable(PlatformLogger.FINER)) {
+            stateLog.finer("Setting MWM_HINTS to " + hints);
+        }
         window.setMWMHints(hints);
     }
 
     /*
      * Under some window managers if shell is already mapped, we MUST

@@ -978,11 +998,13 @@
 
     /*
      * Make specified shell resizable.
      */
     static void setShellResizable(XDecoratedPeer window) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell resizable " + window);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell resizable " + window);
+        }
         XToolkit.awtLock();
         try {
             Rectangle shellBounds = window.getShellBounds();
             shellBounds.translate(-window.currentInsets.left, -window.currentInsets.top);
             window.updateSizeHints(window.getDimensions());

@@ -1008,12 +1030,14 @@
      * @param shellBounds bounds of the shell window
      */
     static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds,
                                      boolean justChangeSize)
     {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
                                                        ", shellBounds " + shellBounds +", just change size: " + justChangeSize);
+        }
         XToolkit.awtLock();
         try {
             /* Fix min/max size hints at the specified values */
             if (!shellBounds.isEmpty()) {
                 window.updateSizeHints(newDimensions);

@@ -1140,21 +1164,25 @@
         int wm_state = window.getWMState();
         if (wm_state == XUtilConstants.WithdrawnState) {
             stateLog.finer("WithdrawnState");
             return false;
         } else {
+            if (stateLog.isLoggable(PlatformLogger.FINER)) {
             stateLog.finer("Window WM_STATE is " + wm_state);
         }
+        }
         boolean is_state_change = false;
         if (e.get_atom() == XA_WM_STATE.getAtom()) {
             is_state_change = true;
         }
 
         for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
             is_state_change |= proto.isStateChange(e);
+            if (stateLog.isLoggable(PlatformLogger.FINEST)) {
             stateLog.finest(proto + ": is state changed = " + is_state_change);
         }
+        }
         return is_state_change;
     }
 
     /*
      * Returns current state (including extended) of a given window.

@@ -1301,11 +1329,13 @@
               case OPENLOOK_WM:
               default:
                   res = defaultInsets;
             }
         }
-        if (insLog.isLoggable(PlatformLogger.FINEST)) insLog.finest("WM guessed insets: " + res);
+        if (insLog.isLoggable(PlatformLogger.FINEST)) {
+            insLog.finest("WM guessed insets: " + res);
+        }
         return res;
     }
     /*
      * Some buggy WMs ignore window gravity when processing
      * ConfigureRequest and position window as if the gravity is Static.