Crashing when re-opening window on Wayland
Aknowledgements
-
[X] I have checked that there's no other issue describing the same or similar problem that I currently have, regardless if it has been closed or open.
-
[ ] I can confirm that this is not an issue with the Discord website, but it is a problem specific to the WebCord itself. I have tested if this bug occurs on Chromium/Chrome or any other Chromium-based browser that uses unpatched/upstream Chromium engine.
-
[X] I have tried running the build from the
masterbranch and it does not have any fixes implemented according to my issue. -
[X] My issue describes one of the unstable and/or not fully implemented features.
-
[ ] I have found a workaround to mitigate or temporarily fix this issue in affected releases (please write it in Additional context section below).
Operating System / Platform
🐧️ Linux
Operating system architecture
x64 (64-bit Intel/AMD)
Electron version
v20.x.y, v20.1.0
Application version
v3.8.0+
Bug description
When using Wayland, I've been having an issue where I'll close the WebCord window (thus hiding it to the tray), and when I try open it back up (using either the toggle button in the tray icon menu or the GNOME application launcher), WebCord crashes. This happens with both the AppImage and the Flatpak.
Additional context
For reference, I'm using Fedora Silverblue 36 (with GNOME) with an AMD graphics card. Flatpak permissions are default. I don't know if this would have occurred on versions before v3.8.0.
Here's the log for when I use Flatpak:
~ ❯❯❯ flatpak run io.github.spacingbat3.webcord
[4:0830/232747.399258:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[4:0830/232747.399336:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
Gkr-Message: 23:27:47.414: secret service operation failed: org.freedesktop.DBus.Error.ServiceUnknown
[WebSocket] Listening at port 6463.
[50:0830/232747.463268:ERROR:gpu_init.cc(486)] Passthrough is not supported, GL is egl, ANGLE is
[UPDATE] Application is up-to-date!
[4:0830/232758.822663:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@32: error 0: gtk_shell::get_gtk_surface already requested
/app/bin/run.sh: line 21: 4 Trace/breakpoint trap (core dumped) env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/bin/webcord/usr/bin/webcord $FLAGS "$@"
I get the last two lines when I try to open the window back up.
This is how the log looks when I use AppImage (exec line for the .desktop file being ~/WebCord-3.8.1-x64.AppImage --ozone-platform=wayland:
~ ❯❯❯ gtk-launch menulibre-webcord
~ ❯❯❯ [11621:0831/000501.104925:ERROR:gpu_init.cc(486)] Passthrough is not supported, GL is egl, ANGLE is
[11570:0831/000501.259206:ERROR:browser_main_loop.cc(270)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[WebSocket] Listening at port 6463.
[UPDATE] Application is up-to-date!
[11570:0831/000504.755096:ERROR:browser_main_loop.cc(270)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[11570:0831/000506.249828:ERROR:browser_main_loop.cc(270)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[11570:0831/000513.052865:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@32: error 0: gtk_shell::get_gtk_surface already requested
I'm having the same situation. Even passing the switch --disable-gpu.
I'm experiencing this as well on the Flatpak variant.
Here's the log for when I use Flatpak:
Flatpak variants are not being considered to be fixed, I do not maintain them.
[4:0830/232747.399258:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory [4:0830/232747.399336:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory Gkr-Message: 23:27:47.414: secret service operation failed: org.freedesktop.DBus.Error.ServiceUnknown
These errors seem to be associated with Flatpak sandboxing.
[11570:0831/000513.052865:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@32: error 0: gtk_shell::get_gtk_surface already requested
This looks like an internal Chromium engine error, it might be fatal according to your description but I'm unsure about this. It is probably a bug with Electron or Chromium. It would be great to get information how app would behave on different Electron versions or if this bug can be reproduced in older WebCord version rather confirming the issue like:
I'm experiencing this as well on the Flatpak variant.
...or...
I'm having the same situation. Even passing the switch --disable-gpu.
Flatpak variants are not being considered to be fixed, I do not maintain them.
I figured you didn't support the flatpak, but the flatpak was how I first encountered the error, so I thought I'd just include everything for good measure/just in case. Sorry if it was unnecessary.
It would be great to get information how app would behave on different Electron versions or if this bug can be reproduced in older WebCord versions
I could definitely see if I can replicate the issue on older versions of WebCord. I'd actually also be interested in testing if it happens in other similar apps, but I'm not sure how I could test that other than maybe set Discord up as a web app in Chromium. Do you think that might work? I'm not much of a dev, so I'm not too sure about these things.
So, I just tested this bug on WebCord 3.6.0 using the AppImage, which is Electron 19.something, and it seems like I replicated it. Here's the log:
~ ❯❯❯ gtk-launch appimagekit_751cdfccc53752949dec7d30e38af2f5.desktop
2022/08/31 23:04:15 Exit Status: -1
2022/08/31 23:04:15 [6135:0831/230318.710783:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is
[6093:0831/230318.831535:ERROR:browser_main_loop.cc(271)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[6093:0831/230323.650762:ERROR:browser_main_loop.cc(271)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[6093:0831/230325.992031:ERROR:browser_main_loop.cc(271)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[6093:0831/230414.524471:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@31: error 0: gtk_shell::get_gtk_surface already requested
2022/08/31 23:04:15 ----------------------------
2022/08/31 23:04:15 Notification:
2022/08/31 23:04:15 Cannot open WebCord
2022/08/31 23:04:15 [6135:0831/230318.710783:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is
[6093:0831/230318.831535:ERROR:browser_main_loop.cc(271)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[6093:0831/230323.650762:ERROR:browser_main_loop.cc(271)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[6093:0831/230325.992031:ERROR:browser_main_loop.cc(271)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[6093:0831/230414.524471:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_surface@31: error 0: gtk_shell::get_gtk_surface already requested
As usual, the application didn't crash until I tried reopening the window after closing it. I'm not sure if the notification would give us a clue as to whether or not this error is fatal, but it looks like it, so I included it.
I did end up with similar UI issues brought up in this comment; I don't know if that would impact anything (I assume not), but hey, may as well be thorough.
I have a similar issue on NixOS and have been following an issue here: https://github.com/electron/electron/issues/35657. Electron 23 seems to have the fix eluded to here: https://github.com/electron/electron/issues/35657#issuecomment-1432397183