Render: Adjust rectangle before restoring the window size again.
Renderer: Resize the window by communicating with the UI thread.