microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.88k stars 29.52k forks source link

VSCode windows not staying in their respective virtual desktops on app restart #146915

Open ghylander opened 2 years ago

ghylander commented 2 years ago

Issue Type: Bug

Open an arbitrary number of VSCode windows. Split them randomly among a number of virtual desktops. Restart VSCode All windows open in the same virtual desktop

I'm on W11 (can't recall wether this happened in W10 too). Quite annoying, specially because the new W11 virtual desktop UI lags tremendously on my PC, meaning each time I have to re-move the VSCode windows to the virtual desktops I want them in I can spend 5 minutes doing so.

A plethora of other apps follow the expected behaviour: Sublime text Edge RStudio Visual Studio etc

VS Code version: Code - Insiders 1.67.0-insider (f050b17dacedba13962244b13c70084a473d08f7, 2022-04-06T05:15:56.751Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No Remote OS version: Linux x64 5.4.0-1059-aws

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz (8 x 1190)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|11.70GB (1.86GB free)| |Process Argv|--crash-reporter-id 4285aea8-8024-49ba-97f2-9d60622a70f0| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: AWS| |OS|Linux x64 5.4.0-1059-aws| |CPUs|Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (8 x 3195)| |Memory (System)|30.91GB (0.69GB free)| |VM|0%|
Extensions (11) Extension|Author (truncated)|Version ---|---|--- jupyter-keymap|ms-|1.0.0 remote-containers|ms-|0.232.3 remote-ssh|ms-|0.78.0 remote-ssh-edit|ms-|0.80.0 remote-wsl|ms-|0.66.0 vscode-remote-extensionpack|ms-|0.21.0 python|ms-|2022.4.0 vscode-pylance|ms-|2022.3.4 jupyter|ms-|2022.4.1000971004 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 (2 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30422396 pythontb:30258533 pythonptprofiler:30281269 vsdfh931:30280409 vshan820:30294714 pythondataviewer:30285072 vscod805cf:30301675 pythonvspyt200:30323110 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 wslgetstarted:30449409 pythonvspyt640:30438691 vscscmwlcmt:30465136 pynewfile477:30451556 ```
yume-chan commented 2 years ago

Previous failed FRs: #111376, #116358, #138936

Also see https://github.com/microsoft/vscode/issues/123517#issuecomment-837871920

ghylander commented 2 years ago

111376 seems to be related, but does not happen in my pc, new windows are opened in whichever virtual desktop I am

As #116358 and #138936, this is more a bug than a feature request... anyways, let's way for that voting poll thing 😔

Syul968 commented 2 years ago

I just experienced this with latest update prompt, in Win 10. This messes up my workflow so I'm less likely to update on prompt now.

Version: 1.67.1 (user setup) Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d Date: 2022-05-06T12:37:03.389Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.19044

zeel01 commented 2 years ago

This issue has been a major reason for me to avoid installing new updates more than once a month. With many windows across multiple virtual desktops, closing and restoring everything all at once is a real pain. I have to take stock of what windows I have where before letting VS Code reload, so that I can then manually move the windows back to the appropriate desktops.

I'll also add to the list: Google Chrome does this correctly.

vscodenpa commented 1 year ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vscodenpa commented 1 year ago

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vscodenpa commented 1 year ago

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Felice-Enellen commented 1 year ago

As I mentioned on #123517 recently, I think this request should really be to more comprehensive, like "windows need to remember as much desktop manager state as is available on each OS as possible".

For instance, at least on Windows, the windows remember their positions, but they do not remember whether or not they were minimized. Probably not maximized either. I wouldn't be surprised if there's other state that should really be saved as well.

I'm sure it's just a case of looking up one or more API calls to get the state and copy/pasting the code that serializes the x/y/w/h state that's saved already, then using the complementary set calls to repopulate the state on restart.

starball5 commented 1 year ago

In addition to those mentioned in https://github.com/microsoft/vscode/issues/146915#issuecomment-1092388983,

jd-solanki commented 1 year ago

I daily open my mac and have to arrange my 5 VSCode windows in respective workspace 😬

@bpasero Can you please consider this for upcoming releases?

bpasero commented 1 year ago

My current understanding is that it needs support from Electron, specifically https://github.com/electron/electron/issues/5362 and/or https://github.com/electron/electron/issues/10124.

elia-ba commented 8 months ago

Note that a possible workaround for this would be to use tools that set the window's desktop based on the window title, then use different VSCode profiles to determine which desktop to place the window on. Most desktop environments in Linux allow you to do this, probably there's something on Windows too.

The issue though is that VSCode does not set the title at window creation time but at some point much later, so the above workaround cannot be used. Making sure that the title is set at window creation time could at least offer this workaround.

bronius commented 1 month ago

the windows remember their positions, but they do not remember whether or not they were minimized

That's what brought me here: I feel that Visual Studio Code used to remember which windows were minimized and which were not, so it feels like a regression. The reason I seem to recall it is because I distinctly recall being so pleased that vscode restarts never interrupted my workflow: Old windows, even unsaved "large clipboard workspace" documents come right back up.

Fwiw, I just checked with old standard Sublime Text, and it also does not remember windows' minimized states.