Duplicate App in Default Application List - Why?

I've installed Google Chrome to use PWAs, following the guide in the help section - Install Google Chrome - Zorin Help

Now in Default Applications, Google Chrome is listed twice.

Why? Is there a fix for this?

I'm not overly concerned, per se, but trying to learn Linux as I go, and this has come up as a peculiarity.

Did You had installed Chrome as Flatpak before?

No, negative.

Running apt list --installed only returns a single google-chrome-stable entry.

Uninstalling with sudo apt remove google-chrome-stable then returns nil (zero) Google Chrome options under Default Applications. Reinstalling reverts back to two.

Results consistent across two different devices, one a PC and another a laptop.

I think it's because it's detecting multiple "desktop" files. These files are meant to describe a launcher, to create the little preview that appears when you search for an application in the applications menu.

On a default installation of Zorin OS I also have two entries for Brave which is based on Chromium. I'm not sure if that's something to do with it or not, but after installing Google Chrome I also find two entries:

find /usr/share/applications/ -type f -iname "*chrome*"
/usr/share/applications/google-chrome.desktop
/usr/share/applications/com.google.Chrome.desktop

That second entry named with the unique identifier, very much in style with Flatpak, though not sure if it's connected somehow, has this message at the top (I actually copied this from the Brave entry, but it's otherwise identical):

This is the same as brave-browser.desktop except NoDisplay=true prevents
duplicate menu entries. This is required to match the application ID
used by XDG desktop portal, which has stricter naming requirements.
The old desktop file is kept to preserve default browser settings.

The fact that this shows for Chromium based browsers makes me think this is a Chromium thing.

You can hide one of them, though not sure if it will have an impact on something else, by adding a new line inside that file:

Hidden=true
4 Likes

Interesting.

The difference between NoDisplay=true and Hidden=true does make the difference.

I'm unsure as to any follow on consequences if I were to use Hidden=true, so I'll leave it as is at present.

Good to know it's not an issue, and that I'm not the only one.

I suspect this is done as mean to future proof the development of the browser(s) for the various types of package formats that exist for Linux.

For example, installing the Flatpak version of Chrome would create an executable named "com.google.Chrome", and "com.brave.Browser" for Brave, which matches exactly that other file.

In case you're curious, here's the specification of what these "desktop" files do and what each key does. The "Hidden" key effectively acts as a "soft delete" of that program, as if it didn't exist:

So, while there may be no apparent negative effect right now, this might change in the future. Just speculating, though.