Adapt inpu size with window size