QT QDialog bug under metacity and a workaround

QDialog under QT 4.8 and 5.3 (I haven’t tested other versions. 5.3 was the latest) doesn’t behave well under Ubuntu 12.04 (using Unity 2D under metacity). The workaround is to trick metacity and make it believe a QDialog is a normal window.

//example inside the QDialog
this->setWindowFlags(Qt::Window);
this->showFullScreen();

I already reported the bug and the workaround to QT and I’ve put a bigger explanation on stackoverflow since Metacity/Digia/QT won’t do anything to solve it.

https://bugreports.qt-project.org/browse/QTBUG-16034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#comment-246262

http://stackoverflow.com/questions/12645880/fullscreen-for-qdialog-from-within-mainwindow-only-working-sometimes