You have a piece of code at the closing event of the window that saves the window position and size. This is cool but you CAN’T do this if the window is MAXIMIZED!!
Before saving the values, set the window to normal. This way you can save the real values and not the maximized values! Please, this is very anoying because when I re-open the atom, I need to move the window to resize