Bug 1045000, deminiaturize before making the window key to fix flickering window, r=smichaud
Bug 1045000, don't set the previously focused element to a window, which can later cause the window to focus and bring itself to the front when the panel closes, r=dao