notifications applet has duplicate entries

Bug #1562409 reported by fossfreedom
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Low
Unassigned
gnome-control-center (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

https://launchpadlibrarian.net/250060042/Screenshot%20from%202016-03-26%2022-25-11.png

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gnome-control-center 1:3.18.2-1ubuntu6
ProcVersionSignature: Ubuntu 4.4.0-15.31-generic 4.4.6
Uname: Linux 4.4.0-15-generic x86_64
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
CurrentDesktop: GNOME
Date: Sat Mar 26 22:25:40 2016
InstallationDate: Installed on 2015-12-12 (104 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Alpha amd64 (20151209)
SourcePackage: gnome-control-center
UpgradeStatus: No upgrade log present (probably fresh install)

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

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

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
Revision history for this message
Saurav Sengupta (sauravsengupta) wrote :

This problem was there in Ubuntu (GNOME) 16.04, and still remains in 16.10. It seems that the duplicate entries come from multiple .desktop files in /usr/share/applications/. There is also a duplicate entry for Rhythmbox that appears in "Open with..." prompts, etc. (One of the Rhythmbox entries is for selecting an input source, but the name in the .desktop file is the same as the one for the main entry.) All this may be because of providing entries for the Ubuntu Unity desktop.

Deleting or renaming one .desktop file for File Roller does remove the duplicate entry for Archive Manager while having no ill-effects, but deleting or renaming one or other of the .desktop files for Nautilus causes the Files entry to disappear from either the dash or the Applications menu. In any case, an update to any of the applications will put the .desktop file and thus the duplicate entry back again, and it will be a matter of constantly correcting /usr/share/applications/ manually or automatically; a less than desirable workaround. Comparing with another standard GNOME desktop, such as in Fedora Workstation, and investigating possible conflicts with entries meant for the Unity desktop may help. One option may be to tweak the "OnlyShowIn" entries in the .desktop files.

description: updated
Changed in gnome-control-center (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Saurav Sengupta (sauravsengupta) wrote :

I also note in passing that all .desktop files which are duplicated, e.g., the ones for Totem and GNOME Terminal, also cause duplicate entries to appear in the GNOME Shell dash if these applications are added to Favourites.

Revision history for this message
Saurav Sengupta (sauravsengupta) wrote :

As I see it, the situation seems to be as follows:-

GNOME now uses the "reverse-DNS" format for the file names of several .desktop files, as given in the freedesktop.org specification, e.g., org.gnome.FileRoller.desktop. However, there are older .desktop files installed for these programs as well, and the newer org.gnome.*.desktop files have NoDisplay=true. So the system shows the desktop entries from the older files, but the there being two files for each (both with X-GNOME-UsesNotifications=true) causes duplicate entries to appear in the Notifications panel and the dash.

The correct solution would be either to not have the older files at all OR to have X-GNOME-UsesNotifications=false in one set of files (but the latter may not prevent duplicate entries from appearing in the dash).

To use the files with the new naming format, the following seems to work (Ubuntu GNOME 16.10 upgraded to GNOME 3.22 using gnome3-staging PPA):-
 1. For every org.gnome.*.desktop file, remove or rename the corresponding file of the older naming style. For example, sudo mv file-roller.desktop file-roller.desktop.orig .
 2. In every org.gnome.*.desktop file:-
  a) Comment out the NoDisplay=true line.
  b) Either comment out the OnlyShowIn line, or change every occurrence of OnlyShowIn=Unity; to OnlyShowIn=Unity;GNOME; .

However, the old-style files may get re-created after an update. To prevent this, create an empty file anywhere and, in ~/.local/share/applications/, create symbolic links with the same names, to the empty file. For example, ln -s empty file-roller.desktop . I don't know whether the lines commented out in the org.gnome.*.desktop files will also get undone after updates, although the freedesktop.org specification does say that comments must be preserved across reads and writes.

Revision history for this message
Saurav Sengupta (sauravsengupta) wrote :

Notes:

* Errata for workaround mentioned in comment #5: Every org.gnome.*.desktop file does not have a corresponding duplicate file. The workaround needs to be used only for the ones that do.

* It also seems that the file /usr/share/applications/nautilus-folder-handler.desktop becomes redundant if the workaround is used. This file causes two entries for "Files" to appear in the Open With... list. Two entries for Rhythmbox also appear, but that is because of /usr/share/applications/rhythmbox-device.desktop having Name=Rhythmbox.

* With the workaround, Totem (GNOME Videos) gets actions (Play/Pause, etc.) in its context menu. The actions don't work for me in GNOME Shell. They can be removed by commenting out the Actions= line in org.gnome.Totem.desktop or by using the old-style totem.desktop file instead of the newer one.

* The workaround works in GNOME Shell. I have not seen what effects it has in Unity (if it is co-installed, for instance), and it may break things there.

Revision history for this message
joshas (joshas) wrote :

No more duplicate items on Ubuntu 17.10 with gnome-control-center 1:3.26.1-0ubuntu5

Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in gnome-control-center (Ubuntu):
importance: Medium → Low
status: Confirmed → Fix Released
Revision history for this message
Paul White (paulw2u) wrote :

Further to comment #8, belatedly closing the Papercuts task as being fixed.

Changed in hundredpapercuts:
importance: Medium → Low
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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