Don't initialize gui just before hiding window

This fixes lp:1246283, which was caused by windows being hidden as soon
as they were shown for the first time, which was probably bad because
the window would not have been fully initialized.