NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.21k stars 14.2k forks source link

`vscode-fhs` starts with wmclass set as `code-url-handler` #344035

Closed ahydronous closed 2 days ago

ahydronous commented 1 month ago

Describe the bug

VSCode starts with its wmclass set wrong, which causes various bugs like being unable to be pinned to the dash, and opening new windows under a separate icon instead of under its "main" icon.

image

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open VSCode
  2. Try to pin it
  3. Open a window

Expected behavior

VSCode should be able to be pinned, and windows should nest under the icon properly.

Additional context

See: https://github.com/VSCodium/vscodium/issues/1414 and https://github.com/microsoft/vscode/issues/129953 for the same issue. I am assuming this also affects the vscode, vscodium and vscodium-fhs NixOS packages.

The Microsoft issue contains references to workarounds/fixes/patches.

Notify maintainers

@eadwu @Synthetica9 @bobby285271 @Enzime


Add a :+1: reaction to issues you find important.

griffi-gh commented 1 month ago

normal vscode package does that too.
on kde, you can override the desktop file with a window rule to make it group with the pinned icon properly.

onnyyonn commented 2 weeks ago

on kde, you can override the desktop file with a window rule to make it group with the pinned icon properly.

@griffi-gh can you please elaborate on how to do that?

griffi-gh commented 2 weeks ago

on kde, you can override the desktop file with a window rule to make it group with the pinned icon properly.

@griffi-gh can you please elaborate on how to do that?

@onnyyonn image Create a window rule like this Set desktop file name to vscode's .../share/applications/code.desktop (in my case, /etc/profiles/per-user/user/share/applications/code.desktop)

or, with plasma-manager:

    {
      description = "vscode-desktop-file";
      match.window-class = "code code-url-handler";
      apply.desktopfile = "/etc/profiles/per-user/user/share/applications/code.desktop";
    }

you may want to use actually specify path to the vscode package instead of hard-coding it tho!

Luflosi commented 2 days ago

This should be fixed in https://github.com/microsoft/vscode/pull/231472. I believe version 1.95.0 includes this fix. Vscodium has only been updated two days ago and should be available in the cache in the following days. Please reopen if this is still a problem.