skip to Main Content

I have found multiple discussions complaining about OpenFile dialog window of VSCode open in background, so you need to use your mouse pointer to bring it up, which is kind of annoying, but did not found a solution.
Is this a bug or unpleasant feature?
Any solution?

I am using

Version: 1.71.2
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Date: 2022-09-14T21:12:14.256Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-48-generic
Sandboxed: No

On Ubuntu 20.04.

4

Answers


  1. It is an upstream issue and I am facing the same. The best-known solution to me is to downgrade the vscode from v1.71.2 to v1.67.2

    No fix has been made to date as mentioned here.

    Login or Signup to reply.
  2. Another workaround to run the latest version 1.72.2 on ubuntu 20.04 with on openFile dialog in foreground (to date the bug is still not fixed) is to add the environment variable GTK_USE_PORTAL=1 when running vscode, in your bash:

    > GTK_USE_PORTAL=1 code
    

    Also, you can create a new desktop launcher, that you can add it to your task bar, in ~/.local/share/application/vscode.desktop :

    [Desktop Entry]
    Name=VSCode
    Comment=Code Editing. Redefined.
    GenericName=Text Editor
    Exec=env GTK_USE_PORTAL=1 /usr/share/code/code --unity-launch %F
    Icon=com.visualstudio.code
    Type=Application
    StartupNotify=false
    StartupWMClass=Code
    Categories=TextEditor;Development;IDE;
    MimeType=text/plain;inode/directory;application/x-code-workspace;
    Actions=new-empty-window;
    Keywords=vscode;
    
    [Desktop Action new-empty-window]
    Name=New Empty Window
    Exec=env GTK_USE_PORTAL=1 /usr/share/code/code --new-window %F
    Icon=com.visualstudio.code
    
    Login or Signup to reply.
  3. I figured out how to create a workaround using this instruction

    I created a file ~/.config/devilspie2/code.lua with the following content:

    if (get_application_name() == 'code' and get_window_role() == 'GtkFileChooserDialog') then focus_window() center(); end
    
    Login or Signup to reply.
  4. The workaround I use is this one. vscode opens the dialog for local file edits but uses a simple menu for remote file edits. So I just set vscode to use simple menu all the time.

    I just set the setting Files -> Simple Dialog = true

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search