More management of the main window

Fix #7