App indicator does not show icon for Qt apps or with custom icons

Bug #1600136 reported by David Planella
74
This bug affects 15 people
Affects Status Importance Assigned to Milestone
appmenu-qt5 (Ubuntu)
Fix Released
High
Marco Trevisan (Treviño)
Xenial
Fix Released
High
Unassigned
libappindicator (Ubuntu)
Fix Released
High
Marco Trevisan (Treviño)
Xenial
Fix Released
High
Unassigned
qtbase-opensource-src (Ubuntu)
Fix Released
High
Marco Trevisan (Treviño)
Xenial
Confirmed
High
Unassigned
sni-qt (Ubuntu)
Fix Released
High
Marco Trevisan (Treviño)
Xenial
Fix Released
High
Unassigned

Bug Description

Snaps that use the app indicator area via Qt can't display their icon there.

Steps to reproduce and screenshot:
https://github.com/nuttyartist/notes/pull/77

Some research:

- Uses http://doc.qt.io/qt-5/qsystemtrayicon.html
- The indicator icon is created under /tmp under a randomly generated directory name

didrocks mentions also:

1. The application says "this is my menu, and here is my icon at that address", the address being /tmp/blablabla
2. appindicator receives the bus messages
3. and says "let's have a look at this icon at that address"
4. BUT! /tmp in the snap is different form system /tmp

====================================================================================

SRU bug for libappindicator:

[Impact]

Indicator icons pointing to a position inside the snap aren't properly found by unity, that shows a "missing icon" emblem

[Test case]

* Download this yaml file http://pastebin.com/raw/FpEvQYGN and save it as snapcraft.yaml
  in any folder you want
* Run:
  - snapcraft prime
  - sudo snap try prime
  - snap run gtk3-appindicator

An indicator should open (with proper icon), then if you select "Set icon with Full Path" and/or "Enable Local Theme" from its menu, you should see a proper icon.

When snaps are generated in non updated systems, the icon will be still missing.

[Regression potential]

If $SNAP is defined for an app not running in snap confinement the icons couldn't be properly visible

====================================================================================

SRU bug for appmenu-qt5:

[Impact]

Indicator icons pointing to a position inside the snap aren't properly found by unity, that shows a "missing icon" emblem

[Test case]

* Download this yaml file http://pastebin.com/raw/KeZ1udjW and save it as snapcraft.yaml
  in any folder you want
* Run:
  - snapcraft prime
  - sudo snap try prime
  - snap run qt5-systray

An indicator should open, with the proper icon showin. From the window you can change the icon type, and all the types should work.

When snaps are generated in non updated systems, the icons (except the Themed one) will be still missing.

[Regression potential]

If $SNAP env variable is defined for an app not running in snap confinement the icons couldn't be properly visible

====================================================================================

SRU bug for sni-qt:

[Impact]

Indicator icons pointing to a position inside the snap aren't properly found by unity, that shows a "missing icon" emblem

[Test case]

* Download this yaml file http://pastebin.com/raw/EZjQS5CH and save it as snapcraft.yaml
  in any folder you want
* Run:
  - snapcraft prime
  - sudo snap try prime
  - snap run qt4-systray

An indicator should open, with the proper icon showin. From the window you can change the icon type, and all the types should work.

When snaps are generated in non updated systems, the icons (except the Themed one) will be still missing.

[Regression potential]

If $SNAP env variable is defined for an app not running in snap confinement the icons couldn't be properly visible

Related branches

David Planella (dpm)
tags: added: snap-desktop-issue
removed: desktop
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

To expand a little bit on this. So indeed, what's happening is:
- the client side set some icons/assets in its /tmp (which is != from the system /tmp)
- the client then sends his menu + the icon uri to the system shell
- the system shell tries to open the icon at that address which doesn't exist.

There are multiple issues there:
- as we want snapd to be cross distros, I don't think we can patch Qt, GTK and other toolkits to export indicators with translated path (client side)
- if we go that road, it means we need to make the application aware it's running in a snapd environment, unsure this is wanted
- patching all shells (at least Unity, GNOME Shell and KDE plasma) has the same issue in term of cross distro compatibility (shell-system-side)
- ofc, we don't want /tmp to be the same than the system one
- I don't think apparmor can do this on the fly translations, right? Patching dbus is an option (with a running on snapd awareness), but brings the same issue in term of cross distro distributions.

Any other idea?

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

"- I don't think apparmor can do this on the fly translations, right?"

No, the kernel LSM hooks (which apparmor uses) look at the files themselves.

Based on your explanation, it sounds like it is only the client side (ie, the snap) that needs to change and that it simply must tell the system shell what the icon uri is. As such, one idea would be to put the icons in ~/snap/$SNAP_NAME/... or in /run/shm/snap.$SNAP_NAME.<something> and then set the client uri appropriately.

Assuming that works it then becomes a matter of making this easy for developers. I'm not sure that 'no upstream changes' is the right attitude-- snappy is a new way of doing things and asking upstream to make reasonable changes shouldn't necessarily be avoided at all costs. That said, I think the preload idea of Gustavo's (see bug #1577514) could help with not needing client changes for the file write (but the uri the client reports to the shell needs to be corrected-- maybe the client libraries honor TMPDIR or some other env variable and you can set it to ~/snap/$SNAP_NAME/... or /run/shm/snap.$SNAP_NAME.<something> (and then you wouldn't even need the preload library)).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
vodopad27 (family-gan) wrote :

Please, fix it. I can not use Telegram snap: https://github.com/sergiusens/telegram-snap/issues/2

Changed in sni-qt (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
summary: - App indicator does not show icon for Qt apps
+ App indicator does not show icon for Qt apps or with custom icons
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

So...

The problem for generic apps should be fixed. You can see some examples here:
 - https://github.com/3v1n0/indicators-examples-snaps

Basically we export to unity the proper absolute icon path, unless that's readable (so basically it can be everywhere inside the SNAP but in /tmp).
They're using remote parts indicator-<toolkit>, although I hope to include this in the desktop launchers by default.

As for some QT apps that don't use appmenu-qt, until we don't fix the Qt upstream implementation, the only workaround is to use a different TEMPDIR for them, see https://github.com/sergiusens/telegram-snap/issues/2#issuecomment-261139307.
When bug #1620442 is fixed, it might be ok to set TEMPDIR to XDG_RUNTIME_DIR for a such snap.

Changed in libappindicator (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Changed in snapd (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in appmenu-qt5 (Ubuntu):
status: New → Confirmed
Changed in appmenu-qt5 (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package appmenu-qt5 - 0.3.0+17.04.20161124.2-0ubuntu1

---------------
appmenu-qt5 (0.3.0+17.04.20161124.2-0ubuntu1) zesty; urgency=medium

  * AppMenuPlatformSystemTrayIcon: reset app usertime on activation to
    ensure compiz will raise it (LP: #627195)
  * AppMenuPlatformMenuBar: Don't initialize X11 related functions in
    other environments (LP: #1606246)
  * IconCache: get the proper theme path based on the fact we're using a
    themed icon or not (LP: #1600136)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Thu, 24 Nov 2016 18:39:00 +0000

Changed in appmenu-qt5 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sni-qt - 0.2.7+17.04.20161124.2-0ubuntu1

---------------
sni-qt (0.2.7+17.04.20161124.2-0ubuntu1) zesty; urgency=medium

  * statusnotifieritem: reset app usertime on activation to ensure
    compiz will raise it (LP: #627195)
  * IconCache: get the proper theme path based on the fact we're using a
    themed icon or not (LP: #1600136)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Thu, 24 Nov 2016 18:38:52 +0000

Changed in sni-qt (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libappindicator - 12.10.1+17.04.20161129-0ubuntu1

---------------
libappindicator (12.10.1+17.04.20161129-0ubuntu1) zesty; urgency=medium

  * AppIndicator: fix icon and theme paths when running in $SNAP
    environment (LP: #1600136)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 29 Nov 2016 18:04:06 +0000

Changed in libappindicator (Ubuntu):
status: In Progress → Fix Released
robepisc (robepisc)
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Upstream fix for pure Qt apps (when not including appmenu-qt5) is proposed at https://codereview.qt-project.org/#/c/182307/.

Here's the patch for the ubuntu package too.

Changed in qtbase-opensource-src (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Changed in qt:
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
status: New → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "qdbustrayicon-try-to-save-temp-icons-in-readable-location.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I think you meant https://codereview.qt-project.org/182310 (not 182307). Thanks for the patch anyway!

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Yes sure... Wrong paste :-)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Debdiff updated to backport the patches that have just merged upstream.

 - https://codereview.qt-project.org/182492
 - https://codereview.qt-project.org/182564

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Mathew Hodson (mhodson) wrote :

Accepted appmenu-qt5 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/appmenu-qt5/0.3.0+16.04.20170216-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in appmenu-qt5 (Ubuntu Xenial):
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Mathew Hodson (mhodson) wrote :

Accepted libappindicator into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libappindicator/12.10.1+16.04.20170215-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libappindicator (Ubuntu Xenial):
importance: Undecided → High
status: New → Fix Committed
Changed in qtbase-opensource-src (Ubuntu Xenial):
importance: Undecided → High
tags: added: verification-needed
Revision history for this message
Mathew Hodson (mhodson) wrote :

Accepted sni-qt into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sni-qt/0.2.7+16.04.20170217.1-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in sni-qt (Ubuntu Xenial):
importance: Undecided → High
status: New → Fix Committed
Changed in snapd (Ubuntu Xenial):
importance: Undecided → High
tags: added: verification-done
removed: verification-needed
tags: added: isv
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libappindicator - 12.10.1+16.04.20170215-0ubuntu1

---------------
libappindicator (12.10.1+16.04.20170215-0ubuntu1) xenial; urgency=medium

  * AppIndicator: fix icon and theme paths when running in $SNAP
    environment (LP: #1600136)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Wed, 15 Feb 2017 14:14:47 +0000

Changed in libappindicator (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for libappindicator has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package appmenu-qt5 - 0.3.0+16.04.20170216-0ubuntu1

---------------
appmenu-qt5 (0.3.0+16.04.20170216-0ubuntu1) xenial; urgency=medium

  * IconCache: get the proper theme path based on the fact we're using a
    themed icon or not (LP: #1600136)
  * IconCache: use $XDG_RUNTIME_DIR as preferred place where to save
    icons
  * AppMenuPlatformMenuBar: Don't initialize X11 related functions in
    other environments (LP: #1606246)

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Thu, 16 Feb 2017 22:57:56 +0000

Changed in appmenu-qt5 (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sni-qt - 0.2.7+16.04.20170217.1-0ubuntu1

---------------
sni-qt (0.2.7+16.04.20170217.1-0ubuntu1) xenial; urgency=medium

  * statusnotifieritem: reset app usertime on activation to ensure
    compiz will raise it (LP: #627195)
  * IconCache: get the proper theme path based on the fact we're using a
    themed icon or not (LP: #1600136)
  * fsutils: always use $XDG_RUNTIME_DIR if it's set for saving icons

 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Fri, 17 Feb 2017 01:14:24 +0000

Changed in sni-qt (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.7.1+dfsg-2ubuntu4~1

---------------
qtbase-opensource-src (5.7.1+dfsg-2ubuntu4~1) zesty; urgency=medium

  [ Marco Trevisan (Treviño) ]
  * debian/patch/qdbus-tray-icon-use-runtimedir.patch:
    - QDBusTrayIcon: try use runtime or cache for icons (LP: #1600136)
  * debian/patch/qdbus-tray-icon-always-save-icon-in-unity.patch:
    - QDBusTrayIcon: always save the temp icon in Unity (LP: #1600136)

 -- Timo Jyrinki <email address hidden> Thu, 09 Feb 2017 08:42:30 +0000

Changed in qtbase-opensource-src (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtbase-opensource-src (Ubuntu Xenial):
status: New → Confirmed
Changed in snapd (Ubuntu Xenial):
status: New → Confirmed
Mathew Hodson (mhodson)
no longer affects: snapd (Ubuntu)
no longer affects: snapd (Ubuntu Xenial)
affects: snappy → ubuntu-translations
no longer affects: ubuntu-translations
affects: qt → ubuntu-translations
no longer affects: ubuntu-translations
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.