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

Print this page

        

@@ -177,11 +177,13 @@
                            compAccessor.getBackground(target),
                            compAccessor.getFont(target));
     }
 
     public void setTitle(String title) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Title is " + title);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Title is " + title);
+        }
         winAttr.title = title;
         updateWMName();
     }
 
     protected String getWMName() {

@@ -225,11 +227,13 @@
         super.handleFocusEvent(xev);
         XFocusChangeEvent xfe = xev.get_xfocus();
 
         // If we somehow received focus events forward it instead to proxy
         // FIXME: Shouldn't we instead check for inferrior?
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
         focusLog.finer("Received focus event on shell: " + xfe);
+        }
 //         focusProxy.xRequestFocus();
    }
 
 /***************************************************************************************
  *                             I N S E T S   C O D E

@@ -294,11 +298,13 @@
 
     long reparent_serial = 0;
 
     public void handleReparentNotifyEvent(XEvent xev) {
         XReparentEvent  xe = xev.get_xreparent();
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine(xe.toString());
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine(xe.toString());
+        }
         reparent_serial = xe.get_serial();
         XToolkit.awtLock();
         try {
             long root = XlibWrapper.RootWindow(XToolkit.getDisplay(), getScreenNumber());
 

@@ -380,11 +386,13 @@
                 //Fix for 6318109: PIT: Min Size is not honored properly when a
                 //smaller size is specified in setSize(), XToolkit
                 //update minimum size hints
                 updateMinSizeHints();
             }
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Dimensions before reparent: " + dimensions);
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Dimensions before reparent: " + dimensions);
+            }
 
             dimensions.setInsets(getRealInsets());
             insets_corrected = true;
 
             if (isMaximized()) {

@@ -733,11 +741,13 @@
                 case XWM.METACITY_WM:
                 case XWM.MUTTER_WM:
                 case XWM.SAWFISH_WM:
                 {
                     Point xlocation = queryXLocation();
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("New X location: {0}", xlocation);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("New X location: {0}", xlocation);
+                    }
                     if (xlocation != null) {
                         newLocation = xlocation;
                     }
                     break;
                 }

@@ -786,12 +796,13 @@
         checkShellRectSize(shellRect);
         checkShellRectPos(shellRect);
     }
 
     public void setShellBounds(Rectangle rec) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell bounds on " +
-                                                                this + " to " + rec);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell bounds on " + this + " to " + rec);
+        }
         XToolkit.awtLock();
         try {
             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
             XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), rec.width, rec.height);
             XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y);

@@ -799,24 +810,26 @@
         finally {
             XToolkit.awtUnlock();
         }
     }
     public void setShellSize(Rectangle rec) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell size on " +
-                                                                this + " to " + rec);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell size on " + this + " to " + rec);
+        }
         XToolkit.awtLock();
         try {
             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
             XlibWrapper.XResizeWindow(XToolkit.getDisplay(), getShell(), rec.width, rec.height);
         }
         finally {
             XToolkit.awtUnlock();
         }
     }
     public void setShellPosition(Rectangle rec) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell position on " +
-                                                                this + " to " + rec);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell position on " + this + " to " + rec);
+        }
         XToolkit.awtLock();
         try {
             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
             XlibWrapper.XMoveWindow(XToolkit.getDisplay(), getShell(), rec.x, rec.y);
         }

@@ -1015,13 +1028,17 @@
     protected void requestXFocus(long time, boolean timeProvided) {
         // We have proxied focus mechanism - instead of shell the focus is held
         // by "proxy" - invisible mapped window. When we want to set X input focus to
         // toplevel set it on proxy instead.
         if (focusProxy == null) {
-            if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.warning("Focus proxy is null for " + this);
+            if (focusLog.isLoggable(PlatformLogger.WARNING)) {
+                focusLog.warning("Focus proxy is null for " + this);
+            }
         } else {
-            if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Requesting focus to proxy: " + focusProxy);
+            if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                focusLog.fine("Requesting focus to proxy: " + focusProxy);
+            }
             if (timeProvided) {
                 focusProxy.xRequestFocus(time);
             } else {
                 focusProxy.xRequestFocus();
             }

@@ -1134,20 +1151,26 @@
                 focusLog.fine("Focus is on child window - transfering it back to the owner");
                 handleWindowFocusInSync(-1);
                 return true;
             }
             Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();
+            if (focusLog.isLoggable(PlatformLogger.FINEST)) {
             focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
                             "\nKFM's focused window: " + focusedWindow);
+            }
 
             // See 6522725, 6613426.
             if (target == realNativeFocusedWindow) {
+                if (focusLog.isLoggable(PlatformLogger.FINE)) {
                 focusLog.fine("The window is already natively focused.");
+                }
                 return true;
             }
         }
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
         focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
+        }
 
         if (timeProvided) {
             toFocus.requestXFocus(time);
         } else {
             toFocus.requestXFocus();