I'm not sure if the logic you moved to getDefaultGeometry depends on the dialog being visible but at this point in the bootup process the preferences dialog is not yet visible (it starts hidden until the user opens it for the first time). You might want to move this code that reads the geometry to onShow in case or maybe @daschuer knows.