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

Windows: window on secondary monitor does not restore at exact position #36122

Closed
bpasero opened this Issue Oct 12, 2017 · 7 comments

Comments

Projects
None yet
5 participants
@bpasero
Member

bpasero commented Oct 12, 2017

This can happen when VS Code on a secondary monitor is not full screen. I filed electron/electron#10768 and electron/electron#10771

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Oct 17, 2017

Member

Maybe causes #35148

Member

bpasero commented Oct 17, 2017

Maybe causes #35148

@robinsh

This comment has been minimized.

Show comment
Hide comment
@robinsh

robinsh Oct 18, 2017

@bpasero Just FYI: I opened VS Code, put it on the second monitor, maximized it, then closed it. When I reopened it, it opened it (maximized) on the Surface tablet. That's at least better than it showing up off-screen. When do you think my original problem (appearing off-screen) might be fixed?

robinsh commented Oct 18, 2017

@bpasero Just FYI: I opened VS Code, put it on the second monitor, maximized it, then closed it. When I reopened it, it opened it (maximized) on the Surface tablet. That's at least better than it showing up off-screen. When do you think my original problem (appearing off-screen) might be fixed?

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Oct 19, 2017

Member

@robinsh we require a fix in our upstream component Electron. I hope to get something for this milestone but it might slip.

Member

bpasero commented Oct 19, 2017

@robinsh we require a fix in our upstream component Electron. I hope to get something for this milestone but it might slip.

@davidnjohnson

This comment has been minimized.

Show comment
Hide comment
@davidnjohnson

davidnjohnson Oct 19, 2017

In case it helps anyone who stumbles on this issue; the problem is the most severe when the zoom level of the primary monitor doesn't match the secondary monitor. I suspect the saved coordinates are being erroneously multiplied by the zoom level of the primary monitor, rather than the ones on the secondary monitor. (I finally ended up setting my 4K primary monitor to 1920x1080 with 100% zoom, which fixed the positioning issue on VSCode open)

davidnjohnson commented Oct 19, 2017

In case it helps anyone who stumbles on this issue; the problem is the most severe when the zoom level of the primary monitor doesn't match the secondary monitor. I suspect the saved coordinates are being erroneously multiplied by the zoom level of the primary monitor, rather than the ones on the secondary monitor. (I finally ended up setting my 4K primary monitor to 1920x1080 with 100% zoom, which fixed the positioning issue on VSCode open)

@robinsh

This comment has been minimized.

Show comment
Hide comment
@robinsh

robinsh Oct 19, 2017

Thanks @davidnjohnson . I don't know if I can bear changing the resolution on my Surface just for this one problem, but if I get desperate, I'll try it out!

robinsh commented Oct 19, 2017

Thanks @davidnjohnson . I don't know if I can bear changing the resolution on my Surface just for this one problem, but if I get desperate, I'll try it out!

@robinsh

This comment has been minimized.

Show comment
Hide comment
@robinsh

robinsh Oct 19, 2017

@bpasero Thanks very much. It's quite maddening. Will I get any kind of notification when it's been fixed?

robinsh commented Oct 19, 2017

@bpasero Thanks very much. It's quite maddening. Will I get any kind of notification when it's been fixed?

@bpasero bpasero modified the milestones: October 2017, November 2017 Oct 30, 2017

@bpasero bpasero closed this in 3589bcd Nov 1, 2017

@bpasero

This comment has been minimized.

Show comment
Hide comment
@bpasero

bpasero Nov 1, 2017

Member

I pushed a workaround in VS Code that seems to fix this by calling window.setPosition in case the retrieved position is different from what we passed in.

To verify:

  • connect an external monitor to have 2 monitors
  • move VS Code to the external monitor (do not maximize the window)
  • close VS Code and restart
  • the position should be the same as before

Maybe use VS Code stable to verify the issue reproduces with your setup.

Member

bpasero commented Nov 1, 2017

I pushed a workaround in VS Code that seems to fix this by calling window.setPosition in case the retrieved position is different from what we passed in.

To verify:

  • connect an external monitor to have 2 monitors
  • move VS Code to the external monitor (do not maximize the window)
  • close VS Code and restart
  • the position should be the same as before

Maybe use VS Code stable to verify the issue reproduces with your setup.

@mjbvz mjbvz added the verified label Nov 3, 2017

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.