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

If I switch workspace, focus moves to different VS Code instance #106727

Closed
wivory opened this issue Sep 15, 2020 · 8 comments
Closed

If I switch workspace, focus moves to different VS Code instance #106727

wivory opened this issue Sep 15, 2020 · 8 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-window Window management

Comments

@wivory
Copy link

wivory commented Sep 15, 2020

Issue Type: Bug

I have 2 VS code instances running, each using a different workspace. If I switch the second instance to a third workspace, I'm immediately 'moved' to the other VS Code instance. When I move back, I can see that the workspace has been changed, but it's not exactly helpful being forcibly moved to the other VS Code instance. This worked fine prior to the most recent upgrade, though IIRC it did happen at one point in the past and I had to revert to an earlier version for a while.

Has the default value of some setting been changed? It's incredibly annoying being moved between instances of VS Code, especially when they are in different linux virtual workspaces.

VS Code version: Code 1.49.0 (e790b93, 2020-09-10T13:20:50.359Z)
OS version: Linux x64 5.4.0-47-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 3588)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 2, 2
Memory (System) 62.43GB (45.55GB free)
Process Argv --no-sandbox
Screen Reader no
VM 0%
DESKTOP_SESSION cinnamon
XDG_CURRENT_DESKTOP X-Cinnamon
XDG_SESSION_DESKTOP cinnamon
XDG_SESSION_TYPE x11
Extensions (18)
Extension Author (truncated) Version
cpputest-test-adapter bne 0.1.6
yacc car 1.3.1
gitlens eam 10.2.2
go gol 0.16.2
vscode-test-explorer hbe 2.19.1
workspacesort ici 1.5.9
plantuml jeb 2.13.13
kite kit 0.123.0
autoconf mae 0.1.0
code-groovy mar 0.1.2
python ms- 2020.8.108011
vscode-pylance ms- 2020.9.4
cpptools ms- 1.0.0
vscode-groovy-lint Nic 1.2.8
vscode-print pdc 0.7.15
rf-intellisense Tom 2.8.0
vscode-workspace-explorer tom 1.5.0
yang-vscode typ 2.0.3
@bpasero
Copy link
Member

bpasero commented Sep 15, 2020

@wivory can you post exact steps how to reproduce from zero preferrably with a fresh user data dir code --user-data-dir <empty dir>

@bpasero bpasero added the info-needed Issue requires more information from poster label Sep 15, 2020
@wivory
Copy link
Author

wivory commented Sep 15, 2020

First, I have reverted from 1.49.0 to 1.48.2 and the problem has disappeared, so whatever is in my user data dir used to work just fine prior to the latest release. So, for now at least, I can't see any use in using a fresh user data dir.

I'm running Ubuntu 20.04 with Cinnamon window manager. I have 5 virtual workspaces in use (I'll call these Cinnamon-workspaces below for clarity). To reproduce the problem:

  • start 'code' in one Cinnamon-workspace; it starts and opens the last used code-workspace
  • start 'code' in a second Cinnamon-workspace (it comes up not set to any workspace, as expected)
  • select code-workspace 'B' in second code instance. I'm immediately moved to the Cinnamon-workspace containing the first instance of 'code'. If I move back to the Cinnamon-workspace containing the second instance of 'code', it has switched to the requested workspace.

In Code 1.48.2, when I select the code-workspace B in the second code instance, this instance of code opens the requested workspace, and I remain viewing this code instance in this Cinnamon-workspace, as you would expect.

@bpasero bpasero assigned deepak1556 and unassigned bpasero Sep 15, 2020
@bpasero bpasero self-assigned this Sep 15, 2020
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Sep 15, 2020
@bpasero bpasero added this to the September 2020 milestone Sep 15, 2020
@bpasero
Copy link
Member

bpasero commented Sep 15, 2020

Ok, I am not sure about how "Cinnamon Window Manager" behaves, but since you indicate it used to work in 1.48 this maybe another Electron 9 update related regression.

@deepak1556 I know I added the app.focus({ steal: true}) to circumvent Electron's breaking change on macOS to not activate the app when it is in the background but I notice that I use it even on Linux and Windows. So my change in b9947f2 makes it conditional for mac only, please check.

@wivory
Copy link
Author

wivory commented Sep 15, 2020

Thanks - will this ship in next month's release?

@bpasero
Copy link
Member

bpasero commented Sep 15, 2020

@wivory yes, but would be great if you could verify in our insider build tomorrow

@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label Sep 16, 2020
@bpasero
Copy link
Member

bpasero commented Sep 16, 2020

@wivory our insider build is out: https://code.visualstudio.com/insiders/

@wivory
Copy link
Author

wivory commented Sep 16, 2020 via email

@perlun
Copy link

perlun commented Oct 30, 2020

Thanks for the fix @bpasero - I can confirm that vscode 1.50.1 (d2e414d) indeed fixes my problem as well, as reported in #108174. Much appreciated. 👏 🙇

@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-window Window management
Projects
None yet
Development

No branches or pull requests

5 participants
@perlun @bpasero @deepak1556 @wivory and others