Atom does not restore UI state


#1

Hello!

I have a problem with Atom, it does not remember window size and position when I restart, even if I open same directory. However I’ve found a strange way that does trigger Atom to save the window state.

1 - Open atom: atom .
2 - Change size and/or window position
3 - Close window or quit Atom
4 - Relaunch atom .
5 - Atom now opens and has forgotten the changes you made

Redo step 1 and 2 and either open a new window Cmd+Shift+N, or start Atom again, atom .
Continue with step 3 and 4 and you’ll see it now remembers window position.

Also reloading the window after a resize resets window dimensions.

Is it intended to work like this? Does Atom only save window state when it renders a(nother) window.

I looked into the source and it says it stores window dimensions when a window unloads.

 handleWindowBeforeunload: (event) =>
    @atomEnvironment.storeWindowDimensions()

TL;DR
Open Atom
Resize/move window
Reload window
Expected window dimensions to remain the same, but they actually change back as they were when you opened Atom.

Very thankful for help if someone can clarify.
Atom version 1.14.4
macOS 10.12.3


#2

Just found out that it saves the window state on window blur. So clicking outside the window, then closing it actually saves the ui state… strange.


#3

Dropping a link to the issue in case anyone wants to follow along :v:


#4

This works! Thanks.