Do not compute sizes within dialogs when they're not visible
It makes our system do stuff unnecessarily, it often warns that the dialog is not even the right size and it will be called anyway when the dialog is displayed, so just do it when it's necessary.
WIP because QT_QPA_PLATFORM=xcb breaks it
Edited by Aleix Pol Gonzalez