NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.06k stars 14.1k forks source link

VS Code show blank transparent dialog (Wayland) & show wrong color (X11) #326510

Open Anifyuli opened 3 months ago

Anifyuli commented 3 months ago

Describe the bug

I use VS Code, and sometimes I get transparent dialog if I open some dialog (look like open Help > About). And I get wrong color with Gruvbox theme in X11 session, but it look normal in Wayland.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open VS Code (in X11 or Wayland)
  2. Wrong color appear (in X11)
  3. Open some features, dialog appear, and it appear with blank transparent dialog

Expected behavior

It run flawlessly

Screenshots

Wrong color in X11 image

Show blank transparent dialog in Wayland image

Additional context

I haven't idea to fix it. I wish it fixed soon as possible

Notify maintainers

@eadwu @Synthetica9 @bobby285271 @JohnRTitor

Metadata

[anifyuli@ThinkPad-X280:~]$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.01 MiB download, 0.05 MiB unpacked):
  /nix/store/5r0df66ikad3xw06azlqvswcvncll8wa-stdenv-linux
copying path '/nix/store/5r0df66ikad3xw06azlqvswcvncll8wa-stdenv-linux' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.37, NixOS, 24.11 (Vicuna), 24.11.20240709.feb2849`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.4`
 - channels(root): `"home-manager, nixos, nixos-hardware"`
 - nixpkgs: `/nix/store/xr9wjzx0cdnwkmhzz74h8lphgn5jmyv3-source`

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

JohnRTitor commented 3 months ago

Is that GNOME? sounds like a theme issue.

eclairevoyant commented 3 months ago

please share your vscode-related nix config and list of extensions

Anifyuli commented 3 months ago

Is that GNOME? sounds like a theme issue.

Yeah, it's on GNOME. I use Adw-gkt3 for GTK 3 themes

Anifyuli commented 3 months ago

please share your vscode-related nix config and list of extensions

I just use install it on user level packages like in this screenshot image

I install it from VS Code directly without write it with Nix configs.

JohnRTitor commented 3 months ago

CC @jtojnar

Anifyuli commented 3 months ago

Sometimes I get my other Electron-based app like GDevelop (installed from Flatpak) get this transparent window problem too, but in VS Code worse than in other apps

jtojnar commented 3 months ago

I would try in clean session with themes and Shell extensions disabled.

Also try running it in console and see if there is any output. And if there is anything in system journal.

I install it from VS Code directly without write it with Nix configs.

What do you mean directly?

Anifyuli commented 3 months ago

What do you mean directly?

I mean I just install VS Code without configure it with Nix expression for adding extensions or tweak it settings. An issue in my report (transparent dialog window) is solved after I update my system this day, but wrong color issue in X11 still unfixed. You can see in my latest screenshot on Wayland it fixed. But in X11 it still same image

Anifyuli commented 1 month ago

I found for fixing wrong color in VS Code (X11 session). Just open Command Pallete, select "Preferences: Configure Runtime Arguments" & add "force-color-profile": "srgb" at end line before last curly brackets. I think it must default on VS Code installation in NixOS for avoid wrong color issue in X11. It looks like this image

CC : @JohnRTitor @eadwu @Synthetica9 @bobby285271

JohnRTitor commented 1 month ago

You can make it the default for yourself by using

enviroment.systemPackages = [
  (pkgs.vscode.override {
    # fix of theme error in X11
    commandLineArgs = ''--force-color-profile=srgb'';
  })
];

(no need to put it in argv.json)

I am not sure if it would be feasible and appropriate to force srgb color profile for all users, especially if the bug occurs only in X11 and in a specific DE.

Anifyuli commented 1 month ago

I see, thanks for your solutions