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

Print this page




1122         if (toFocus == null || !toFocus.focusAllowedFor()) {
1123             // This might change when WM will have property to determine focus policy.
1124             // Right now, because policy is unknown we can't be sure we succedded
1125             return false;
1126         }
1127         if (this == toFocus) {
1128             if (isWMStateNetHidden()) {
1129                 focusLog.fine("The window is unmapped, so rejecting the request");
1130                 return false;
1131             }
1132             if (target == activeWindow && target != focusedWindow) {
1133                 // Happens when an owned window is currently focused
1134                 focusLog.fine("Focus is on child window - transfering it back to the owner");
1135                 handleWindowFocusInSync(-1);
1136                 return true;
1137             }
1138             Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();
1139             focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
1140                             "\nKFM's focused window: " + focusedWindow);
1141 
1142             // See 6522725, 6613426.
1143             if (target == realNativeFocusedWindow) {
1144                 focusLog.fine("The window is already natively focused.");
1145                 return true;
1146             }
1147         }
1148         focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
1149 
1150         if (timeProvided) {
1151             toFocus.requestXFocus(time);
1152         } else {
1153             toFocus.requestXFocus();
1154         }
1155         return (this == toFocus);
1156     }
1157 
1158     XWindowPeer actualFocusedWindow = null;
1159     void setActualFocusedWindow(XWindowPeer actualFocusedWindow) {
1160         synchronized(getStateLock()) {
1161             this.actualFocusedWindow = actualFocusedWindow;
1162         }
1163     }




1122         if (toFocus == null || !toFocus.focusAllowedFor()) {
1123             // This might change when WM will have property to determine focus policy.
1124             // Right now, because policy is unknown we can't be sure we succedded
1125             return false;
1126         }
1127         if (this == toFocus) {
1128             if (isWMStateNetHidden()) {
1129                 focusLog.fine("The window is unmapped, so rejecting the request");
1130                 return false;
1131             }
1132             if (target == activeWindow && target != focusedWindow) {
1133                 // Happens when an owned window is currently focused
1134                 focusLog.fine("Focus is on child window - transfering it back to the owner");
1135                 handleWindowFocusInSync(-1);
1136                 return true;
1137             }
1138             Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();
1139             focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
1140                             "\nKFM's focused window: " + focusedWindow);
1141 
1142             // See 6522725, 6613426, 8009224
1143             if (target == realNativeFocusedWindow && XWM.getWMID() != XWM.ENLIGHTEN_WM) {
1144                 focusLog.fine("The window is already natively focused.");
1145                 return true;
1146             }
1147         }
1148         focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
1149 
1150         if (timeProvided) {
1151             toFocus.requestXFocus(time);
1152         } else {
1153             toFocus.requestXFocus();
1154         }
1155         return (this == toFocus);
1156     }
1157 
1158     XWindowPeer actualFocusedWindow = null;
1159     void setActualFocusedWindow(XWindowPeer actualFocusedWindow) {
1160         synchronized(getStateLock()) {
1161             this.actualFocusedWindow = actualFocusedWindow;
1162         }
1163     }