vscode: Windows: different zoom levels on different monitors fail to restore windows at correct location

  • VSCode Version:1.52.1
  • OS Version: Windows_NT x64 10.0.18363

Steps to Reproduce: I have extension screens setup:

  • Main screen: laptop resolution 3840x2160 and enlarger text& application size to 200%
  • extension screen 1: ultrawide screen 2516x1080, no enlargerment
  • extension screen 2: nomral wide screen: 1920x1080, no enlargerment

and using FancyZones from PowerToys to manage my screens. =================================

  1. put vscode in extension screen 1 or 2
  2. Drag vscode window & press shift (shortcut of FancyZones) to put to a target sub-screen
  3. close vs code, reopen it

Vscode window positon will not restore to the position where I closed it. In addtion, the vscode window size seems enlargered to 200%. My guess is vscode restores window size & position based the coordinator of main screen rather then the extension screen. I am not sure it is vscode’s bug or FancyZones messed up OS ( win10) ?

If I just put vscode in main screen or extension screens without using draging it to a subscreen, it works fine.

============================= I double checked. It seems nothing to do with FancyZones. If I put vscode in the certain postion in extension screen but close to main screen, the problem will happen.

Does this issue occur when all extensions are disabled?: Yes/No N/A

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (13 by maintainers)

Most upvoted comments

I can repro some non-restoring behavior with 1 monitor at 250% and the other at 100% with stable, but I can’t repro with insiders. Verified.

Insiders is back to Electron 13 for a moment, so hold your breath until we resume Electron 16.

this seems to be fixed for me on insiders after the electron update

Opening for help wanted, as I do not have a good windows setup with multiple monitors right now. If someone wants to chime in with this setup (Windows, 2 monitors, 1 with zoom to 200%) willing to help, a good start to figure out what goes wrong is here:

https://github.com/microsoft/vscode/blob/5c330b06d4df1e2c7b17b629b7b31df4b85efea5/src/vs/platform/windows/electron-main/window.ts#L133

Either the state from the previous session is already wrong or we fail to restore it properly.