Merge pull request #4030 from clinchergt/fix-setfocus-rendertowindow Fix focus bug when using the "render to main window" feature