mode (such as mirror) is saved to window.g