set active tab and window