Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: save UI state automatically before OS reboot #89291

Closed
3 tasks done
bpasero opened this issue Jan 26, 2020 · 4 comments
Closed
3 tasks done

Test: save UI state automatically before OS reboot #89291

bpasero opened this issue Jan 26, 2020 · 4 comments

Comments

@bpasero
Copy link
Member

bpasero commented Jan 26, 2020

Refs: #12058, #87171

Complexity: 2

There is 2 sources of state that we so far only saved on a normal shutdown:

  • UI state (e.g. use the list of opened editors and the editor layout to test this)
  • Window state (use the size and location of the window to test this).

On most OS, if you simply restart the OS, VSCode will be terminated leaving no time to persist the UI state. To mitigate this, VSCode will now

  • save state every minute automatically
  • save state as soon as the VSCode window looses focus (for example if the user clicks on Start > Reboot, we would have a chance to persist state before this happens)

Verify

  • open a couple of editors and/or set a specific editor layout and then alt+tab to another app and click the OS restart button. Verify that after restart of the OS when you open VSCode, that editor state is restored exactly how you left it
  • make a change to the window dimensions or window position and then alt+tab to another app and click the OS restart button. Verify that after restart of the OS when you open VSCode, the window opens in that position and size
@bpasero
Copy link
Member Author

bpasero commented Jan 28, 2020

I pushed a small but significant change today around finding out if a window has focus or not. I have a new insiders build running with that change and ask to please use that build once its out. Will post it here...

@fiveisprime
Copy link
Member

Looks good ✔️

Tested on internal and external monitor since Windows scaling can get interesting with varying resolutions. Works well even when disconnecting from external monitor while restarting.

@fiveisprime fiveisprime removed their assignment Jan 28, 2020
@mjbvz mjbvz removed their assignment Jan 28, 2020
@btholt
Copy link

btholt commented Jan 29, 2020

LGTM, worked on macOS

@btholt btholt closed this as completed Jan 29, 2020
@btholt btholt removed their assignment Jan 29, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants