I am developing an application in PySide on Windows and Linux (Ubuntu). On Windows everything works as expected. But on Linux, when I open a modal dialog box in the application (even system dialogs, e.g. OpenFileDialog), the global application menu still stays visible and active. What is the meaning of modality then?
I know this is likely a duplicate to this: Application menu is enabled even if a modal dialog box is open
According to it, if I understand well, I would have to keep the reference to the global application menu in each dialog box and disable all the menu actions when the modal dialog box is opened. And enable it when it is closed. Hard to believe this is the only option. It is just stupid overkill...
So is there any other option how to solve it? For example keeping the menu bar below the main window title bar as we have in on Windows... I know it may be not native Linux "feel and look" then but it is much better than having global menu in modal windows.
Or am I missing some simple and obvious solution?
You can actually keep the menu bar right below the window title to avoid this problem by disabling the
QMenu.nativeMenuBar
property.Here is an example with PyQt4: