set the mainwin as the active window