DBus menu: Implement visibility and automatically hide the menu when the window is blocked by a modal dialog