I have a program that hides in a system tray area. It uses few dialogs for interactions with user. The problem is when i hide my app to tray with some dialogs still open. After restoring the windows to normal stated, dialogs disappear. The problem occurs on Ubuntu 17.10 with Qt 5.9.2, but I suppose that other Linux distributions may have this problem as well. I tested it with Plasma, GNOME and Unity. Same result. Windows version of my program works correctly, windows are hidden and restored as expected. Simple code can present the issue:

Qt Code:
  1. #include <QtWidgets>
  2. #include <QtGui>
  3.  
  4. int main(int argc, char *argv[]) {
  5. QApplication a(argc, argv);
  6. QDialog d(&w);
  7. QTimer::singleShot(1000, [&] { w.show(); });
  8. QTimer::singleShot(2000, [&] { d.show(); });
  9. QTimer::singleShot(3000, [&] { w.showMinimized(); });
  10. QTimer::singleShot(4000, [&] { w.hide(); });
  11. QTimer::singleShot(5000, [&] { w.show(); });
  12. QTimer::singleShot(6000, [&] { w.showNormal(); });
  13. a.exec();
  14. }
To copy to clipboard, switch view to plain text mode 

After w.hide() dialog won't show again. Any additional calls of dialog methods like show(), showNormal() do nothing. Any ideas? Is this a bug, or is there something wrong with my code?