Fix issue that the drawing area will not be refreshed when the window is moved