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

Window in fullscreen does not restore to correct monitor in some cases #25400

Closed
ivankovnatsky opened this issue Apr 26, 2017 · 8 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@ivankovnatsky
Copy link

ivankovnatsky commented Apr 26, 2017

Currently VSCode will open in fullscreen on my default monitor instead of a monitor where I left it off (closed it).

So I have to drag/move it to my external monitor (VSCode in fullscreen mode).

  • VSCode Version: 1.11.2
  • OS Version: macOS 10.12.4

Steps to Reproduce:

Insiders build actually acted same as usual build.

If to follow this scenario:

  • Open VSCode in window mode on default screen
  • Move VSCode to another screen
  • Enter fullscreen mode in VSCode
  • Close VSCode
  • Open VSCode
  • VSCode will open on remembered/last screen

that is expected, I think.

Another scenario:

  • Open VSCode in window mode on one screen
  • Enter fullscreen mode
  • Move VSCode to screen two
  • Close VSCode
  • Open VSCode
  • VSCode will be opened on screen one instead of screen two

to simplify: VSCode will save position if it's in window mode

I hope that makes sense.


I've tried similar scenarios with default macOS apps, say Notes. And it's position/state have been saving either it's in window or fullscreen mode.

@bpasero
Copy link
Member

bpasero commented Apr 26, 2017

That is weird, we do support that scenario. Does it reproduce when using our insiders release?
Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: http://code.visualstudio.com/Download#insiders

@bpasero bpasero added the info-needed Issue requires more information from poster label Apr 26, 2017
@bpasero bpasero added this to the Backlog milestone Apr 26, 2017
@ivankovnatsky
Copy link
Author

ivankovnatsky commented Apr 26, 2017

@bpasero, my fault I didn't mention about fullscreen mode. Because I mainly use VSCode in fullscreen mode.

Insiders build actually acted same as usual build.

But if to follow this scenario:

  • Open VSCode in window mode on default screen
  • Move VSCode to another screen
  • Enter fullscreen mode in VSCode
  • Close VSCode
  • Open VSCode
  • VSCode will open on remembered/last screen

that is expected, I think.

Another scenario:

  • open VSCode in window mode on one screen
  • Enter fullscreen mode
  • Move VSCode to screen two
  • Close VSCode
  • Open VSCode
  • VSCode will be opened on screen one instead of screen two

to simplify: VSCode will save position if it's in window mode

I hope that makes sense.


I've tried similar scenarios with default macOS apps, say Notes. And it's position/state have been saving either it's in window or fullscreen mode.

@ivankovnatsky ivankovnatsky changed the title Feature Request: Consider adding ability to remember screen/external monitor placement Feature Request: Consider adding ability to remember screen when in full-screen mode Apr 26, 2017
@bpasero bpasero changed the title Feature Request: Consider adding ability to remember screen when in full-screen mode Does not restore to correct monitor when using fullscreen Apr 26, 2017
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug workbench and removed info-needed Issue requires more information from poster labels Apr 26, 2017
@bpasero bpasero modified the milestones: April 2017, Backlog Apr 26, 2017
@bpasero
Copy link
Member

bpasero commented Apr 26, 2017

Ok let me try to repro that.

@bpasero
Copy link
Member

bpasero commented Apr 27, 2017

@sevenfourk there is a workaround for your problem:

  • make sure "window.restoreFullscreen": true is configured
  • start VS Code once normally and put it on your external monitor and close
  • start again, the window should restore on that external monitor
  • now turn into fullscreen mode and quit
  • restart and it should restore on that monitor

The issue is in https://github.com/Microsoft/vscode/blob/master/src/vs/code/electron-main/window.ts#L601 where it reads still carry over window dimensions from previous sessions! in a comment and the motivation was to restore the state from the previous session is window.restoreFullscreen is disabled (which is the default). However, a better fix would be to restore the previous state (size) on the correct monitor.

@bpasero bpasero modified the milestones: Backlog, April 2017 Apr 27, 2017
@bpasero bpasero changed the title Does not restore to correct monitor when using fullscreen Window in fullscreen does not restore to correct monitor in some cases Apr 27, 2017
@ivankovnatsky
Copy link
Author

@bpasero thanks, yeah, that's how I did it.

Thanks for taking care of that.

@bpasero bpasero modified the milestones: May 2017, Backlog May 6, 2017
@bpasero bpasero closed this as completed in 56b341c May 6, 2017
@bpasero
Copy link
Member

bpasero commented May 6, 2017

Verification:

  • macOS
  • set "window.restoreFullscreen": true
  • have at least 2 monitors
  • start VS Code on one monitor, normal sized (not fullscreen) and close it
  • start VS Code again, move the window to the other screen and fullscreen it
  • restart and verify VS Code opens on the correct monitor

@ivankovnatsky
Copy link
Author

@bpasero, thanks.

@Lixire Lixire added the verified Verification succeeded label Jun 1, 2017
@ivankovnatsky
Copy link
Author

Great, 1.13.0 already has this fix. Thanks.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants