Open Baughn opened 2 years ago
It renders fine if you disable hardware acceleration in settings first (obviously done on Xorg)
For anyone who just wants it to work, here's a workaround you can put in your environment.systemPackages:
# Work around #159267
(pkgs.writeShellApplication {
name = "discord";
text = "${pkgs.discord}/bin/discord --use-gl=desktop";
})
(pkgs.makeDesktopItem {
name = "discord";
exec = "discord";
desktopName = "Discord";
})
Remove any existing 'discord' entry, of course.
Hey @Baughn , where do you write this work around? My discord is black screen as well and passing --use-gl=desktop
in the terminal works. However, I don't want to have to do that every time. I am relatively new to Linux, I feel like there is no environment.systemPackages
file. So I'm lost exactly where to put this work around! Thanks!
Edit: Built an executable file to just do it for me. Though still curious where you are talking about.
Electron 17.3.1 with the upstream fix has been released. I guess we need to wait until Discord upgrades their Electron version.
discord --use-gl=desktop
only works because it runs on xorg using xwayland.
Hey @Baughn , where do you write this work around? My discord is black screen as well and passing
--use-gl=desktop
in the terminal works. However, I don't want to have to do that every time. I am relatively new to Linux, I feel like there is noenvironment.systemPackages
file. So I'm lost exactly where to put this work around! Thanks!Edit: Built an executable file to just do it for me. Though still curious where you are talking about.
My comment was only relevant on NixOS, where it’s part of the system configuration file.
You sound like you’re just using Nix. In that case, home-manager does something similar.
Discord recently updated its Electron version. Does the issue still persist?
I can still reproduce it on Discord 0.0.21, Kubuntu 22.10. KDE 5.26
This also started happening for me when I started using nvidia drivers.
For anyone who just wants it to work, here's a workaround you can put in your environment.systemPackages:
# Work around #159267 (pkgs.writeShellApplication { name = "discord"; text = "${pkgs.discord}/bin/discord --use-gl=desktop"; }) (pkgs.makeDesktopItem { name = "discord"; exec = "discord"; desktopName = "Discord"; })
Remove any existing 'discord' entry, of course.
@Baughn This works for me but GNOME doesn't have an icon for Discord, any idea why or how to fix?
I solved it by downloading the icon locally and adding icon = ./discord.png
Why does --use-gl=desktop
do anything at all? It looks like this is supposed to be the default: https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/gl_switches.cc;l=100-101;drc=8bca1335dc7993df8e44307816092f9f9d25d4aa
(Also FWIW, Discord works perfectly fine for me on amdgpu and i915 when started normally (with and without NIXOS_OZONE_WL=1
set) but env -u NIXOS_OZONE_WL Discord --use-gl=desktop
is required on the proprietary nvidia drivers.)
I solved it by downloading the icon locally and adding
icon = ./discord.png
You can also directly reference the icon from your GTK icon theme, here's how I did it using Tela circle:
packages = [
tela-circle-icon-theme
(pkgs.makeDesktopItem {
name = "discord";
exec = "${pkgs.discord}/bin/discord --use-gl=desktop";
desktopName = "Discord";
icon = "${pkgs.tela-circle-icon-theme}/share/icons/Tela-circle/scalable/apps/discord.svg";
})
];
This setup is probably better as you won't need to manually download the icon so this will make your system reproducible. The location of the icon file might differ depending on your icon theme though.
This graphical issue and other chromium / electron based applications graphical issues are probably related to #224332.
I can confirm that setting NIXOS_OZONE_WL=1
fixes the issue for me. How come that isn't the default?
Because it also breaks other things, for example:
I've found that
discord --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations
also works on Wayland
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/all-nividia-drivers-crash-or-do-not-work/47427/4
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/all-nividia-drivers-crash-or-do-not-work/47427/6
Describe the bug
If you start the standalone (Electron-based) Discord client on Wayland, though possibly only Wayland-on-Nvidia, it renders an entirely black window.
This is not nixos-specific. Various workarounds are posted around the internet; the ones that work best are to run it with --disable-gpu, or (preferrably) --use-gl=desktop. I don't know what implications would come of making the second one the default.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
The discord window should render. ;-)
Screenshots
Notify maintainers
@ldesgoui @MP2E @devins2518
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.