In case that the window operation results in destroying the window decoration we need to have the menu closed before the deco gets destroyed. Otherwise Qt crashes.