Define window size according to parameters