fixed redraw bugs when window restored/maximized