Thanks for looking into that Marco! I think the problem might be indeed something with indicator-appmenu. I checked appmenu-qt5 and everything seems fine there: appmenu-qt5 fetches the related QMenu and exports it through DBus. During the hide/show the menu stays the same, the window stays the same, so appmenu-qt5 has no reason to re-export it again as all the previous contents are valid - and appmenu-qt5 really doesn't do much more. It only re-exports menus when the menu parent changes, or the menu itself. Here it has no reason to do that as none of the important bits (the winId or the QMenu) changed. But somehow, the once exported menu is invalidated/lost somewhere.
Thanks for looking into that Marco! I think the problem might be indeed something with indicator-appmenu. I checked appmenu-qt5 and everything seems fine there: appmenu-qt5 fetches the related QMenu and exports it through DBus. During the hide/show the menu stays the same, the window stays the same, so appmenu-qt5 has no reason to re-export it again as all the previous contents are valid - and appmenu-qt5 really doesn't do much more. It only re-exports menus when the menu parent changes, or the menu itself. Here it has no reason to do that as none of the important bits (the winId or the QMenu) changed. But somehow, the once exported menu is invalidated/lost somewhere.
Adding indicator-appmenu to the investigation.