treat menus events if menus is close and simplify popup event treatment