simplify the implementation of global-focus-mode