Make sure window size is not larger than the screen (unless size is fixed)

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>