Fixed double buffer issue and set a fixed window size