Rearrange code to let newly opened tab to be shown a bit earlier
Do not let QMdiArea to steal shortcuts, fixes #168