Properly save and restore geometry of windows

Use event filter in configuration manager to save and restore
geometry of windows.

Save geometry on QEvent::WindowDeactivate and restore it on
QEvent::WindowActivate.