Test whether menuWindows should be closed using regular expression.
Update focused window indicator if the menu is open while the focused window changes.