Setting window delegate.
Add some margin.
Save window location and size.