Fix bug #437163: make sure window menu has a reasonable parent.
Under wayland, when the main menu is assigned to a system notifier icon and gets unparented, it will show as a window when activated by the title bar. To solve this we make sure that the menu always have a valid parent when it is about to be shown.
Edited by Oded Arbel