Skip to content

Notification count is wrong for apps that support com.canonical.Unity.LauncherEntry #2515

Description

@diesieben07

Describe the bug
If an app supports the com.canonical.Unity.LauncherEntry interface to set its badge count (like I suspect many do, I have found Discord and Telegram so far) and also sends desktop notifications, then Dash to Panel will add the two counts, giving a confusing badge.

For example:

  • Message received on Telegram.
  • Telegram sends "please set my badge counter to 1" via com.canonical.Unity.LauncherEntry and also sends a desktop notification.
  • Dash to Panel takes the 1 from the LauncherEntry and adds the 1 unread notification
  • -> App Icon shows a "2" badge, even though there is only one unread message.

Linux distribution and version
Ubuntu 26.04

GNOME Shell version
GNOME Shell 50.1

Dash-to-Panel version
73

Where was Dash-to-Panel installed from?
The GNOME extensions website

Additional Info
This has a fairly simple solution, in my opinion and it is employed by Dash to Dock (and by extension Ubuntu's default dock):
When an app sends a non-zero count via com.canonical.Unity.LauncherEntry then display only that and only show the unread notification count if the app didn't already set a badge itself.

This would be fairly simple to add here:

this._state[appId].total =
((this._state[appId]['count-visible'] || 0) &&
(this._state[appId].count || 0)) + (this._state[appId].trayCount || 0)

The relevant section in Dash to Dock is here:
https://github.com/micheleg/dash-to-dock/blob/248d42bb64c5e4d21203562f2ef68baf8c9ff083/appIconIndicators.js#L853-L868

They guard this behind a setting (application-counter-overrides-notifications), which is true by default, but in my opinion that is not even needed, because adding the two numbers produces only nonsensical, confusing results.

Also I want to take this time to say thank you very much for this wonderful extension which makes GNOME a joy to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions