@Override
  public WindowState getStateFor(@Nullable Project project, @NotNull String key, @NotNull Window window) {
    synchronized (myRunnableMap) {
      WindowStateBean state = WindowStateAdapter.getState(window);
      Runnable runnable = myRunnableMap.put(key, new Runnable() {
        private long myModificationCount = state.getModificationCount();

        @Override
        public void run() {
          long newModificationCount = state.getModificationCount();
          if (myModificationCount != newModificationCount) {
            myModificationCount = newModificationCount;
            Point location = state.getLocation();
            Dimension size = state.getSize();
            putFor(project, key,
                   location, location != null,
                   size, size != null,
                   Frame.MAXIMIZED_BOTH == state.getExtendedState(), true,
                   state.isFullScreen(), true);
          }
        }
      });
      if (runnable != null) {
        runnable.run();
      }
    }
    return getFor(project, key, WindowState.class);
  }
@Override
  public WindowState getStateFor(@Nullable Project project, @NotNull String key, @NotNull Window window)