Ubuntu – Ubuntu 20.04 not updating icons on dock

20.04iconsthemesubuntu-dock

I just upgrade from 18.04 to 20.04, and I have a problem with my docks icons.
The problem is the dock is not updating itself.

  • If I open an app, it won't show.
  • If I close an app, it won't go away
  • If I change from a virtual desktop to another (I have independent virtual desktops since 16.04), I'll continue seeing the icons from the previous one (the little dots showing how many windows are opened on a desktop do update tho).

The only way to update the dock is by changing the icons theme appearance on Tweaks, but I have to shange it every time I open or close an app or everytime I change from one virtual desktop to another.

On some other posts they say the problem fixes when setting the theme to default, but no theme worked for me.

what could it be?
how could I fix it?

Thank you!


Here is a video of the problem.

Note that I have activated long ago the isolate-workspaces setting with gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true
please note that the dock updates the icons whenever I change the icons theme on tweaks. There is some point at 0:54 where the dock updates itself by its own, but this happens once in a while, not always as it should happen.

https://drive.google.com/file/d/1DHJlnF-W_J6PRp6SZNl8AxNd1EbmTRFz/view?usp=sharing

(I want to apology for the typos, english is not my native language and I was on a hurry, just now I watched it and noticed them)

Best Answer

I had the exact same problem, so I investigated.

The root cause is a JS error in /usr/share/gnome-shell/extensions/ubuntu-dock@ubuntu.com/dash.js: JS ERROR: TypeError: firstIcon is undefined (can be seen in journalctl /usr/bin/gnome-shell -f).

I edited the file in-place to make sure this was indeed the problem, and replaced:

        let firstIcon = firstButton.icon;
        
        // Enforce the current icon size during the size request
        firstIcon.setIconSize(this.iconSize);

with

        let firstIcon = firstButton.icon;
        
        // Enforce the current icon size during the size request
        if (firstIcon) {
            firstIcon.setIconSize(this.iconSize);
        }

ensuring that the execution is not stopped if firstIcon is undefined. Then I reloaded the gnome shell using Alt+F2 then r, and lo and behold, the issue was gone!

I haven't investigated the reason why firstIcon was null to begin with. Therefore, I don't know if I have corrected the issue or just one of its symptoms, so I'm not sure if this should be turned into a PR or just a documented bug-report.

Related Question