Closed theRealCarneiro closed 5 months ago
You didn't specify your icon theme, so I couldn't reproduce the issue, and had to try and fix it blindly. Hope it's going to help.
The icon theme is Papirus-Dark, from the papirus-icon-theme from the oficial arch repos. Whatsapp Nativefier pkg from the aur is one that crashes the dock. I just updated it and now i just get a new error (even with everything closed):
~ nwg-dock-hyprland
INFO[0000] Using auto-detected launcher command: 'nwg-drawer'
INFO[0000] Using style: /home/gabriel/.config/nwg-dock-hyprland/style.css
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x5609b206c723]
goroutine 1 [running]:
main.buildMainBox(0x5609b22e9e60?)
./main.go:217 +0xbe3
main.main()
./main.go:559 +0x129e
It doesn't happen to me. Tried on 3 various machines, the dock didn't crash on any of them.
Where do you install whatsapp-nativefier
from? What's on AUR, does not work for me.
I can confirm that this happens for 70% of icon themes I try
> nwg-dock-hyprland -x
INFO[0000] Using auto-detected launcher command: 'nwg-drawer'
INFO[0000] Using style: /home/dusanx/.config/nwg-dock-hyprland/style.css
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x557d46f03437]
goroutine 1 [running]:
github.com/gotk3/gotk3/gtk.(*Image).toWidget(0x557d46f1216e?)
<autogenerated>:1 +0x17
main.pinnedButton.(*Button).SetImage.func4(0xc000020340?, {0x557d47082740, 0x0})
github.com/gotk3/gotk3@v0.6.3/gtk/gtk.go:1853 +0x3a
github.com/gotk3/gotk3/gtk.(*Button).SetImage(...)
github.com/gotk3/gotk3@v0.6.3/gtk/gtk.go:1853
main.pinnedButton({0xc000020340, 0x6})
./tools.go:45 +0x105
main.buildMainBox(0xc00005c128)
./main.go:128 +0x7e7
main.main()
./main.go:567 +0x145e
For example with extra/pop-icon-theme
but with many others too.
My dock contains:
Icon=thunar
Icon=emacs
Icon=terminal
Icon=browser
I can't claim if icon set contains the icon (can dig if needed) that causes crash but I can test anything you want.
Edit: quick check shows that 'pop' theme doesn't have 'thunar' nor 'emacs' icons. This should be easy to simulate.
@nwg-piotr please patch next version with this one line change:
diff --git a/tools.go b/tools.go
index f0c0540..7e6af62 100644
--- a/tools.go
+++ b/tools.go
@@ -32,7 +32,7 @@ func pinnedButton(ID string) *gtk.Box {
box.PackStart(button, false, false, 0)
image, err := createImage(ID, imgSizeScaled)
- if err != nil {
+ if ((err != nil) || (image == nil)) {
pixbuf, err := gdk.PixbufNewFromFileAtSize(filepath.Join(dataHome, "nwg-dock-hyprland/images/icon-missing.svg"),
imgSizeScaled, imgSizeScaled)
if err == nil {
Reason for crash was that tools.go in line 34 image, err := createImage(ID, imgSizeScaled)
was returning image = nil
and err = nil
when icon is missing, so next if
line didn't fire. With new check in line 35 crash doesn't happen any more. It was too tiny change to create proper merge request but this solves the issue.
OK, got it. Thanks.
Describe the bug The dock crashes when there's an open app that does not have an icon for it in the current icon theme. If the app that's causing crashes is closed, the dock will work as expected, as soon as it open the dock crashes. And it doesn't even start when the app is already open.
To Reproduce Steps to reproduce the behavior:
Expected behavior Not crash
Desktop (please complete the following information):
Additional context Have seen this happen with Whatsapp Nativefier, Steam Games, or anything that does not have a specific icon for it in the current theme