Fix initial window size calculations
KMainWindow::applyMainWindowSettings() currently does
unconditionally, but that will always return 640x480. As a result, all
KXMLGUI-using apps will get an initial main window size of 640x480,
overriding whatever size hint they might have set. This yields an
unpolished first impression to the new user due to windows being too
small the first time apps are launched.
Various apps have been working around this by adding an initial
call to their main window code, which is not super desirable, as it
amounts to clients working around a workaround in frameworks.
In order to avoid negative consequences from this workaround, we need to set the newly-created window to have the geometry of the existing widget, which ensures that its sizeHint is applied properly.
This can be tested by removing all width and height related values in the
[MainWindow] section of
~/.config/okularrc and then launching Okular. The main window should be nice and big, not super tiny.