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

Print this page




1095           case XWM.ICE_WM:
1096           case XWM.METACITY_WM:
1097               return true;
1098           case XWM.OPENLOOK_WM:
1099           case XWM.MOTIF_WM:
1100           case XWM.CDE_WM:
1101               return false;
1102           default:
1103               return false;
1104         }
1105     }
1106 
1107 
1108     /**
1109      * Check if state is supported.
1110      * Note that a compound state is always reported as not supported.
1111      * Note also that MAXIMIZED_BOTH is considered not a compound state.
1112      * Therefore, a compound state is just ICONIFIED | anything else.
1113      *
1114      */

1115     boolean supportsExtendedState(int state) {
1116         switch (state) {
1117           case Frame.MAXIMIZED_VERT:
1118           case Frame.MAXIMIZED_HORIZ:
1119               /*
1120                * WMs that talk NET/WIN protocol, but do not support
1121                * unidirectional maximization.
1122                */
1123               if (getWMID() == METACITY_WM) {
1124                   /* "This is a deliberate policy decision." -hp */
1125                   return false;
1126               }
1127               /* FALLTROUGH */
1128           case Frame.MAXIMIZED_BOTH:
1129               for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
1130                   if (proto.supportsState(state)) {
1131                       return true;
1132                   }
1133               }

1134           default:
1135               return false;
1136         }
1137     }
1138 
1139 /*****************************************************************************\
1140  *
1141  * Reading state from different protocols
1142  *
1143 \*****************************************************************************/
1144 
1145 
1146     int getExtendedState(XWindowPeer window) {
1147         int state = 0;
1148         for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
1149             state |= proto.getState(window);
1150         }
1151         if (state != 0) {
1152             return state;
1153         } else {




1095           case XWM.ICE_WM:
1096           case XWM.METACITY_WM:
1097               return true;
1098           case XWM.OPENLOOK_WM:
1099           case XWM.MOTIF_WM:
1100           case XWM.CDE_WM:
1101               return false;
1102           default:
1103               return false;
1104         }
1105     }
1106 
1107 
1108     /**
1109      * Check if state is supported.
1110      * Note that a compound state is always reported as not supported.
1111      * Note also that MAXIMIZED_BOTH is considered not a compound state.
1112      * Therefore, a compound state is just ICONIFIED | anything else.
1113      *
1114      */
1115     @SuppressWarnings("fallthrough")
1116     boolean supportsExtendedState(int state) {
1117         switch (state) {
1118           case Frame.MAXIMIZED_VERT:
1119           case Frame.MAXIMIZED_HORIZ:
1120               /*
1121                * WMs that talk NET/WIN protocol, but do not support
1122                * unidirectional maximization.
1123                */
1124               if (getWMID() == METACITY_WM) {
1125                   /* "This is a deliberate policy decision." -hp */
1126                   return false;
1127               }
1128               /* FALLTROUGH */
1129           case Frame.MAXIMIZED_BOTH:
1130               for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
1131                   if (proto.supportsState(state)) {
1132                       return true;
1133                   }
1134               }
1135               /* FALLTROUGH */
1136           default:
1137               return false;
1138         }
1139     }
1140 
1141 /*****************************************************************************\
1142  *
1143  * Reading state from different protocols
1144  *
1145 \*****************************************************************************/
1146 
1147 
1148     int getExtendedState(XWindowPeer window) {
1149         int state = 0;
1150         for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
1151             state |= proto.getState(window);
1152         }
1153         if (state != 0) {
1154             return state;
1155         } else {