Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“Enable support for indicators” not working properly, Nextcloud tray icon not visible #6143

Closed
guzzard opened this issue Dec 30, 2016 · 40 comments
Labels

Comments

@guzzard
Copy link
Contributor

guzzard commented Dec 30, 2016

Cinnamon version 3.2.7

With “Enable support for indicators” enabled the Nextcloud sync client icon is not visible in the system tray. However the button is there, and it's possible to open the menu etc.
image

In the Looking Glass log you can see that Cinnamon tries to add the Nextcloud tray icon over and over. And sometimes you see these DBus error messages. The log continues to be filled with these messages as long as the Nextcloud client is running. Cinnamon also freezes for a split second every time it tries to add the icon.

info t=2016-12-30T09:43:41Z Adding indicator: Nextcloud
info t=2016-12-30T09:43:41Z Adding indicator: Nextcloud
info t=2016-12-30T09:43:42Z Adding indicator: undefined
warning t=2016-12-30T09:43:42Z While reading menu layout: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.kde.StatusNotifierItem-8155-1 was not provided by any .service files
warning t=2016-12-30T09:43:42Z While reading menu layout: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.kde.StatusNotifierItem-8155-1 was not provided by any .service files
warning t=2016-12-30T09:43:42Z Invalid menu: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.kde.StatusNotifierItem-8155-1 was not provided by any .service files
info t=2016-12-30T09:43:42Z Adding indicator: Nextcloud
info t=2016-12-30T09:43:44Z Adding indicator: Nextcloud
info t=2016-12-30T09:43:45Z Adding indicator: Nextcloud
warning t=2016-12-30T09:43:45Z Invalid menu: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.kde.StatusNotifierItem-8155-1 was not provided by any .service files
info t=2016-12-30T09:43:45Z Adding indicator: Nextcloud
info t=2016-12-30T09:44:41Z Adding indicator: Nextcloud
info t=2016-12-30T09:45:11Z Adding indicator: Nextcloud
info t=2016-12-30T09:45:41Z Adding indicator: Nextcloud
info t=2016-12-30T09:46:11Z Adding indicator: Nextcloud
info t=2016-12-30T09:46:41Z Adding indicator: Nextcloud

Above is also true for the ownCloud sync client which is basically the same application as the Nextcloud sync client.

With “Enable support for indicators” disabled the system tray icon works as expected, but is not running as an indicator icon.

@guzzard guzzard changed the title ”Enable support for indicators” not working properly, Nextcloud tray icon not visible “Enable support for indicators” not working properly, Nextcloud tray icon not visible Dec 30, 2016
@ghost
Copy link

ghost commented Jan 3, 2017

@JosephMcc JosephMcc added the BUG label Jan 3, 2017
@guzzard
Copy link
Contributor Author

guzzard commented Jan 4, 2017

Hi @lestcape, the issue discussed in the owncloud forums is not the same issue I'm having. It's true that no icon appear if owncloud/nextcloud is started without delay during startup. I had this issue before and added a delay which solved that particular issue.

However my current issue is that the button is there in the tray, but icon is not showing. Same thing happens regardless if during startup or if you start the application manually. As you can see in the screenshot it's possible to access the menu even though icon is not showing and the width of the button is very narrow + there are the error messages in the Looking Glas log.

@ghost
Copy link

ghost commented Jan 4, 2017

Ok, but the error message say that the service was not provided... So, this type of things could be related with the start-up time of the service. There are a master service that localized the particular service for an specific indicator. This procedure it's then automatically and then there are not a particular definition of how the service need to be called or where the service it's. The most probably thing then, will be not related with the cinnamon indicators procedure, as the service it's localized in the same way for others indicators in the master service, where all indicators are registered. If the client won't work as others clients, in first place, this need to be a fault of the client itself. This not mean that we can not do anything, but mean that we need to do different things for a particular indicator and of course this is not the best.

@ghost
Copy link

ghost commented Jan 4, 2017

@guzzard you do that:

Now we change the lower ‘n’ to an upper ‘N’, otherwise no icon would appear in Ubuntu’s dashboard:

sed -i 's/Icon=nextcloud/Icon=Nextcloud/g' src/gui/nextcloud.desktop
sed -i 's/Icon[(.*)]=nextcloud/Icon[\1]=Nextcloud/g' src/gui/nextcloud.desktop
make && make install

Source: https://www.c-rieger.de/how-to-install-nextcloud-desktop-client-for-ubuntu/

They apparently have a different names for the icons... In windows this is no a problem, in linux it's.

@ghost
Copy link

ghost commented Jan 4, 2017

See what they do: nextcloud/client_theming@99841e9

You will need to revert this commit, and then install Nextcloud

ghost referenced this issue in nextcloud/client_theming Jan 4, 2017
@ghost
Copy link

ghost commented Jan 4, 2017

Also see this: owncloud/client#5311

@ghost
Copy link

ghost commented Jan 4, 2017

Also see this: owncloud/client#4693

@ghost
Copy link

ghost commented Jan 4, 2017

"Cinnamon also freezes for a split second every time it tries to add the icon."

They know that (owncloud/client#4990) and they are working on it, please see:
owncloud/client#5389 (comment)

Nextcloud use the same code of owncloud. They only modify some things out of the owncloud code.

And don't think this is only related with cinnamon: owncloud/client#5074

@guzzard
Copy link
Contributor Author

guzzard commented Jan 6, 2017

Hi @lestcape, I really appreciate that you spent time looking into this issue. I have looked at the various issues you linked.

nextcloud/client_theming@99841e9 seem to be unrelated. The .desktop-file have the correct naming "Nextcloud".

owncloud/client#5311 is related to another DE (Budgie Desktop).

owncloud/client#4693 setting QT_QPA_PLATFORMTHEME=generic made no difference. The icon is still missing as in my screenshot.

owncloud/client#4990 / owncloud/client#5389 (comment) I think this might be some other issue because I don't see any spikes or high usage of the CPU. It's only that Cinnamon visually freezes for lika 0.1 sec or so when the icon is trying to get added.

I do think however that the issue is with the ownCloud/Nextcloud since there are messages regarding errors when building the menu. I will make a issue report in Nextcloud as well and link with this report.

edit: I tested with OWNCLOUD_MINIMAL_TRAY_MENU=1 set. With that variable set the indicator is only added once, still without the icon visible as in my screenshot, but there are no errors in the Looking Glas log.

@ghost
Copy link

ghost commented Jan 6, 2017

@guzzard What i tray to say, it's that this is apparently an issue in the Nextcloud/owncloud side, not with cinnamon it self.

You are wrong when you say: "nextcloud/client_theming@99841e9 seem to be unrelated. The .desktop-file have the correct naming "Nextcloud".

This have nothing to be with the desktop file. This have to be with the fact that the indicator code it's in the owncloud side and if you change the icon name in the Nextcloud side and do nothing in the owncloud side, you have them an unmatched icons names...

@ghost
Copy link

ghost commented Jan 6, 2017

@guzzard An also see you report 2 things, a missing icon and "Cinnamon also freezes for a split second every time it tries to add the icon".

The freezes have nothing to be with the icons, so of course i reference issues about the freezes, not about the icons... So, they have nothing to be and you can not found the solution to the icons there.

For the icons problem, the solution it' s in my previous comment.

@guzzard
Copy link
Contributor Author

guzzard commented Jan 7, 2017

@lestcape I tested in gnome-shell 3.22 with appindicator support enabled to see if the behavior was the same. Problem is that everything works fine. So I'm a bit confused. You say that changes done in the Nextcloud client code have broken the icon and made it stop working (if I understand you correct), but in that case the Nextcloud client should be broken when started in gnome-shell as well? But it's not as you can see in the screenshot. Appindicator icon/menu is working fine.

nextcloud_gnome_shell_appindicator

@ghost
Copy link

ghost commented Jan 7, 2017

@guzzard sorry, I suppose there are a problem then, because need to happen the same with gnome-shell... Just i don't want to install Nextcloud, i don't like it and has a lot of requirements, but i will need to do it now that i'm a little more sure about the problem...

@ghost
Copy link

ghost commented Jan 7, 2017

@guzzard i can not reproduced the problem that you mention, from the Nextcloud master bransh...
nextcould
nextcould-2

@ghost
Copy link

ghost commented Jan 7, 2017

captura de pantalla de 2017-01-06 19-09-48

@ghost
Copy link

ghost commented Jan 7, 2017

Certainly, if you restart cinnamon you will lost the icon, but this occurs for transmission and more indicators also... You probably don't see the icon in the first image, but it's there...

@ghost
Copy link

ghost commented Jan 7, 2017

captura de pantalla de 2017-01-06 22-41-51

I see that i have not icons at all if "Enable support for indicators", it's not active... I don't know anything about status icons...

@guzzard
Copy link
Contributor Author

guzzard commented Jan 7, 2017

@lestcape thanks for spending the time to test nextcloud. I see that the icon is present in all of the screenshots.

I tried several different version of nextcloud and owncloud clíent, binary packages and built from source. I get the same result for all of them. Appindicator does not work in Cinnamon, but it works in gnome-shell. I assume it must be due to something in my specific installation/configuration of Cinnamon that is causing the issues since it's working fine for you, and it's working fine for me in gnome-shell on the same computer.

I don't know what else I can test at this point. If you have any suggestions please let me know. Thanks!

@ghost
Copy link

ghost commented Jan 7, 2017

I think there are problems in both side, and different versions have different problems... It's no easy at all make it work in this context. They are working on this so will appear more changes. So please, way a little, maybe they can find a way to get it running in a better way for more desktop environments... In my point of view indicators/status icons is probably the most problematic thing in cinnamon right now. @clefebvre also think to fork appindicator, because in fact it's difficult try to fix a thing where you can not modify the code... Probably this will happen and we can have more control of what client want, but also this will not be a complete solution, because the solution will be fix all client and of course this is impossible. But, thats is my opinion.

@Yaksinikos
Copy link

Yaksinikos commented Feb 4, 2017

some for Telegram and TeamSpeak 3 - tray icons are not visible!
Also menu issues with steam, but not confirmed if steam client side or cinnamon, because the icon is shown, just the menu wont show.

@alexanderdd
Copy link

alexanderdd commented May 21, 2017

Nextcloud icon showed up when I first installed it. Now it never shows, but deamon is definitely running.
Same problem with dropbox btw.

[update] I included a 10sec startup delay, now dropbox icon shows, but not nextcloud =(

Linuxmint 18.01, cinnamon 3.2.7, nextcloud 2.3.1, dropbox 26.4.24

@Fjodor42
Copy link

@lestcape, @guzzard: I don't know if the analysis in nextcloud/client_theming#57 is correct, but if so, nextcloud/client_theming@99841e9 is definitely at fault here

@guzzard
Copy link
Contributor Author

guzzard commented May 23, 2017

@Fjodor42 indicator works fine in Gnome Shell etc. If you look at the earlier comments @lestcape also seem to think the icon naming is not the issue after I confirmed that it works fine in Gnome Shell but not in Cinnamon.

Anyway, I "solved" the issue by disabling indicator support in Cinnamon and installed the Colapsible Systray applet to get the tray icons to display nicely with correct size etc.

@Fjodor42
Copy link

@guzzard I'm still not sure that the Nextcloud client is really behaving as it should, but the difference you are seeing could stem from Cinnamon not having certain stock icons, as can be seen from the output of

strace nextcloud 2>&1 |grep hicolor | grep png | grep apps
nextcloud-strace.txt

@Fjodor42
Copy link

Fjodor42 commented Jun 6, 2017

Hmmm, I tried client_theming HEAD without and with reverting nextcloud/client_theming@99841e9 - no difference.

Seems Cinnamon could be at fault after all...

@palday
Copy link

palday commented Jul 11, 2017

Same problem here as @guzzard .

This may be a packaging issue, related to files names, albeit not the same as nextcloud/client_theming@99841e9 .

From dpkg-query -L nextcloud-client, there are no filenames ending in -icon:

/.
/usr
/usr/bin
/usr/bin/nextcloud
/usr/bin/nextcloudcmd
/usr/share
/usr/share/applications
/usr/share/applications/nextcloud.desktop
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/nextcloud-client
/usr/share/doc
/usr/share/doc/nextcloud-client
/usr/share/doc/nextcloud-client/copyright
/usr/share/doc/nextcloud-client/changelog.Debian.gz
/usr/share/doc/nextcloud-client/changelog.gz
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/32x32
/usr/share/icons/hicolor/32x32/apps
/usr/share/icons/hicolor/32x32/apps/Nextcloud.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_error.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/32x32/apps/Nextcloud_ok.png
/usr/share/icons/hicolor/128x128
/usr/share/icons/hicolor/128x128/apps
/usr/share/icons/hicolor/128x128/apps/Nextcloud.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_error.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/128x128/apps/Nextcloud_ok.png
/usr/share/icons/hicolor/22x22
/usr/share/icons/hicolor/22x22/apps
/usr/share/icons/hicolor/22x22/apps/Nextcloud.png
/usr/share/icons/hicolor/16x16
/usr/share/icons/hicolor/16x16/apps
/usr/share/icons/hicolor/16x16/apps/Nextcloud.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_error.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/16x16/apps/Nextcloud_ok.png
/usr/share/icons/hicolor/256x256
/usr/share/icons/hicolor/256x256/apps
/usr/share/icons/hicolor/256x256/apps/Nextcloud.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_error.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/256x256/apps/Nextcloud_ok.png
/usr/share/icons/hicolor/512x512
/usr/share/icons/hicolor/512x512/apps
/usr/share/icons/hicolor/512x512/apps/Nextcloud.png
/usr/share/icons/hicolor/64x64
/usr/share/icons/hicolor/64x64/apps
/usr/share/icons/hicolor/64x64/apps/Nextcloud.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_error.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/64x64/apps/Nextcloud_ok.png
/usr/share/icons/hicolor/48x48
/usr/share/icons/hicolor/48x48/apps
/usr/share/icons/hicolor/48x48/apps/Nextcloud.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_error.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/48x48/apps/Nextcloud_ok.png
/usr/share/icons/hicolor/72x72
/usr/share/icons/hicolor/72x72/apps
/usr/share/icons/hicolor/72x72/apps/Nextcloud_sync.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_error_shared.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_error.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_warn_shared.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_sync_shared.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_warn.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_ok_shared.png
/usr/share/icons/hicolor/72x72/apps/Nextcloud_ok.png
/etc
/etc/sysctl.d
/etc/sysctl.d/101-sync-inotify.conf

@palday
Copy link

palday commented Jul 11, 2017

More specifically, it seems that there's no images being installed to /usr/share/icons/hicolor/symbolic/ and /usr/share/icons/hicolor/scalable/.

@palday
Copy link

palday commented Jul 11, 2017

And a piece of the puzzle that truly makes no sense to me: running Nexcloud with sudo yields the tray icon.This may be why this is so hard for @lestcape to replicate -- it may be a nasty interaction with some other user-specific settings in Cinnamon.

@moretocome
Copy link

Same issue. Nextcloud systray icon works, but indicator does not.

@mainmachine
Copy link

mainmachine commented Sep 1, 2017

Cinnamon 3.4.6, Ubuntu 16.04.3 base

Interestingly, I have a laptop and a desktop both running the same Ubuntu-Mate 16.04.3 base, with Cinnamon from the same PPA, but the desktop exhibits the problem while the laptop does not!

I've tried to identify the source of the problem, but the only common thing I've seen is that running with sudo from a terminal will allow the indicator to show, as others have seen, and that as far as I can tell all of the apps that are affected are QT based (possibly only >= QT5)...

I;ve had this with Owncloud, Nextcloud, Skype, and most recently radeon-profile all exhibit this behavior...

If anyone has anything they'd like me to compare between these two systems, please ask and I will gladly look into it, it would be great to have this solved.

@guzzard
Copy link
Contributor Author

guzzard commented Sep 20, 2017

Hi @clefebvre and @mtwebster,

Can one of you have a look at this issue since @lestcape is not working on Cinnamon anymore as I understand?

I have done some more digging into this..

The issue is not due to naming issues or paths. Nextcloud/ownCloud packages the icon files into the executable using the Qt resource system.

In indicatorManager.js, information such as 'iconName' and 'iconPixmap' among other is fetched through dbus. If the 'iconName' is available this is used to fetch the appropriate icon from /usr/share/icons/ (_createIconByName). If the 'iconName' is empty the 'iconPixmap' is used instead (_createIconFromPixmap ). For Nextcloud/ownCloud the 'iconName' is empty since they use the icons packaged into the executable.

The problem occurs on line 1249 when trying to get the bytes representing the icon from the iconPixmap. This is because bytes is empty.

The problem can be traced back to line 822 in the _getPropertyCallback function.

When trying to get the IconPixmap property from the dbus response with let newValue = conn.call_finish(result).deep_unpack()[0].deep_unpack(); only widths and heights are returned back, the actual byte arrays representing the icons are not returned.

However, using dbus-monitor you can see that the byte arrays are being returned in the response from Nextcloud.

method return time=1505897775.678100 sender=:1.580 -> destination=:1.570 serial=36 reply_serial=1203
   variant       array [
         struct {
            int32 32
            int32 32
            array of bytes [
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               ff 3e ff ff ff 19 ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
               --- cut ---
               ff ff ff ff ff fa ff ff ff fb ff ff ff fb ff ff ff fb ff ff ff
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               00
            ]
         }
         struct {
            int32 64
            int32 64
            array of bytes [
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               ff 00 00 00 00 00 00 00 00 00 00 00 00 0d ff ff ff b2 ff ff ff
               --- cut --- 
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               00 00 00 00
            ]
         }
         struct {
            int32 22
            int32 22
            array of bytes [
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
               --- cut ---
               ff f8 ff ff ff ac ff ff ff 88 ff ff ff a9 ff ff ff f6 ff ff ff
               00 00 00 00
            ]
         }
      ]

I think the problem lies within the deep_unpack() function potentially. Somehow the byte array is lost?

The gnome-shell-extension-appindicator also uses dbus to fetch the icons, and is successfully doing so. I looked briefly at the implementation, but the only thing different that I noticed was that they use an XML schema to define dbus interfaces etc whereas the Cinnamon implementation does it without XML schema.

Anyway, hopefully this info can help in some way.. I don't think I can't get any further with the issue unfortunately.

@guzzard
Copy link
Contributor Author

guzzard commented Sep 21, 2017

Ugly workaround until it's been fixed properly in Cinnamon..

In /usr/share/cinnamon/js/ui/indicatorManager.js:

    // updates the base icon
    _updateIcon: function() {
        // remove old icon
        if (this._mainIcon.get_child()) {
            let child = this._mainIcon.get_child();

            if (child.inUse)
                child.inUse = false;
            else if (child.destroy)
                child.destroy();

            this._mainIcon.set_child(null);
        }

        // place to save the new icon
        let newIcon = null;

        // we might need to use the AttentionIcon*, which have precedence over the normal icons
        if (this._indicator.status == SNIStatus.NEEDS_ATTENTION) {
            let [ name, pixmap, theme ] = this._indicator.attentionIcon;

            // workaround due to IconPixmap issue
            if(name == ""){
                if(Gtk.IconTheme.get_default().has_icon(this._indicator.id.toLowerCase())){
                    name = this._indicator.id.toLowerCase();
                } else if(Gtk.IconTheme.get_default().has_icon(this._indicator.id)){
                    name = this._indicator.id;
                } else {
                    name = "error";
                }
            }
            // workaround end

            if (name && name.length)
                newIcon = this._cacheOrCreateIconByName(name, theme, this._iconSize);

            if (!newIcon && pixmap)
                newIcon = this._createIconFromPixmap(pixmap, this._iconSize);
        }

        if (!newIcon) {
            let [ name, pixmap, theme ] = this._indicator.icon;

            // workaround due to IconPixmap issue
            if(name == ""){
                if(Gtk.IconTheme.get_default().has_icon(this._indicator.id.toLowerCase())){
                    name = this._indicator.id.toLowerCase();
                } else if(Gtk.IconTheme.get_default().has_icon(this._indicator.id)){
                    name = this._indicator.id;
                } else {
                    name = "error";
                }
            }
            // workaround end

            if (name && name.length)
                newIcon = this._cacheOrCreateIconByName(name, theme, this._iconSize);

            if (!newIcon && pixmap)
                newIcon = this._createIconFromPixmap(pixmap, this._iconSize);
        }

        this._mainIcon.set_child(newIcon);
    },

@nem0nxt
Copy link

nem0nxt commented Apr 23, 2018

Allow me to comment also, that the following workaround fixed all the missing icons on the system tray on Linux mint 18.3 Sylvia.

@dansan
Copy link

dansan commented May 30, 2018

Fixed it for me in Debian Stretch with cinnamon* packages in version 3.2.x.

@proximous
Copy link

@guzzard Have you considered offering this patch as a pull request? It did not solve the problem for me with Dropbox and the Jetbrains Toolbox, but with this change I at least get a red no-entry icon instead of simply a blank space. That's a much better error condition handling and I would hope the maintainers would accept it.

@guzzard
Copy link
Contributor Author

guzzard commented Jun 2, 2018

@proximous, my "fix" is just an ugly workaround. However, I have provided quite a lot of details about the problem above, so it should be fairly easy and quick for someone from the Cinnamon team such as @clefebvre, @mtwebster etc to fix it properly..

@nem0nxt
Copy link

nem0nxt commented Jun 2, 2018

@proximous Try "dbus-launch dropbox stop" and "dbus-launch dropox start" from the command line you 'll see that the icon should now show up (ugly workaround but it works). This hack also worked for viber.

@proximous
Copy link

@nem0nxt I did find that "dbus-launch XXX" fixes both dropbox and Jetbrains Toolbox. Does anyone know why? Does that mean the apps aren't using dbus correctly, or does that mean Cinnamon has some bug with dbus?

@guzzard Understood. I'd love to see it fixed, but I stand by my statement that your "ugly workaround" is much better than the existing code, even for cases like mine where it doesn't fix the problem, since at least it fails gracefully. So your "ugly" is "pretty" to me :)

@rik-shaw
Copy link

rik-shaw commented Sep 3, 2018

@guzzard @proximous @nem0nxt @mtwebster @clefebvre Just commenting here that the same issue exists for 'goldendict' (qt5 app): namely that when disabling 'app indicators' the tray icon will show up, but when enabling 'app indicators', the icon won't show (well, it is 1 px wide and I can't get it to respond to a click).

running "sudo goldendict" WILL have the app indicator show up in the tray??!!?? ALSO, running "dbus-launch goldendict" WILL have the app indicator show up in the tray??!!??

So for now I am going to edit the goldendict.desktop launcher to add "dbus-launch goldendict" as the exec statement.

@victort
Copy link

victort commented Sep 24, 2019

i realize this is kinda stale, but for the record, it is only working with the above patch by @guzzard for me on one machine (cinnamon 3.8.8). On another machine ( Cinnamon 4.0.10-2), it makes no difference, the icon is still invisible.

additionally, where it is visible, it does not change with the state of the application.

US$0.02++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests