private void refreshIniValues() {
    // window extended state
    final int state = getExtendedState();
    if(state != WINDOW_EXTEND_STATE) {
      INI.setInteger("window", "state", state);
    }
    setExtendedState(NORMAL); // get the real window bounds
    final Rectangle box = getBounds();
    setExtendedState(state); // restore the extended state
    // window dimension
    if(box.width != WINDOW_WIDTH) {
      INI.setInteger("window", "width", box.width);
    }
    if(box.height != WINDOW_HEIGHT) {
      INI.setInteger("window", "height", box.height);
    }
    // window position
    final Integer[] curPos = new Integer[] { box.x, box.y};
    boolean needPosUpdate;
    if(initialPosition == null || initialPosition.length != 2) {
      needPosUpdate = true;
    } else {
      final boolean samePosition = box.x == initialPosition[0]
          && box.y == initialPosition[1];
      if(wasInCenter && samePosition) {
        INI.set("window", "pos", "");
        initialPosition = null;
      }
      needPosUpdate = !samePosition;
    }
    if(needPosUpdate) {
      INI.setArray("window", "pos", curPos);
      initialPosition = curPos;
    }
  }