private static Boolean isViewableWin(long window) {
      XWindowAttributesWrapper wrapper = null;
      try {
        wrapper = new XWindowAttributesWrapper(window);
        return wrapper.getMapState() == XWindowAttributesWrapper.MapState.IsViewable;
      }
      catch (Exception e) {
        LOG.error(e);
        return false;
      }
      finally {
        if (wrapper != null)
          wrapper.dispose();
      }
    }
private static Boolean isViewableWin(long window)