Format and adjust window size