After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664138 - source is confused
source is confused
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-11-15 19:29 UTC by William Jon McCann
Modified: 2012-01-20 05:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (41.35 KB, image/png)
2011-11-15 19:29 UTC, William Jon McCann
  Details
notificationDaemon: Group based on app name, not PID (2.76 KB, patch)
2011-11-15 20:09 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
notificationDaemon: group sources based on a combination of pid and title (8.19 KB, patch)
2011-12-08 08:21 UTC, Marina Zhurakhinskaya
reviewed Details | Review
notificationDaemon: group sources based on a combination of pid and title (8.45 KB, patch)
2011-12-20 05:52 UTC, Marina Zhurakhinskaya
committed Details | Review
notificationDaemon: fix problem with cherry-pick to gnome-3-2 (1.05 KB, patch)
2012-01-19 18:06 UTC, Owen Taylor
committed Details | Review
notificationDaemon: fix order of arguments to _lookupSource() (962 bytes, patch)
2012-01-19 18:07 UTC, Owen Taylor
committed Details | Review

Description William Jon McCann 2011-11-15 19:29:19 UTC
Created attachment 201477 [details]
screenshot

I have a software updates notification that thinks it is a battery.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-11-15 20:09:36 UTC
Created attachment 201478 [details] [review]
notificationDaemon: Group based on app name, not PID

We still need to keep the PID so we can find the app from the AppSystem, though


--

This is the only sane way to do this sort of thing. Of course, this means
that we need to make g-s-d show a separate app name for each source. I have
no idea if it does this already.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-11-15 20:11:06 UTC
(In reply to comment #1)
> Created an attachment (id=201478) [details] [review]
> notificationDaemon: Group based on app name, not PID
> 
> We still need to keep the PID so we can find the app from the AppSystem, though
> 
> 
> --
> 
> This is the only sane way to do this sort of thing. Of course, this means
> that we need to make g-s-d show a separate app name for each source. I have
> no idea if it does this already.

The answer is "yes".
Comment 3 Marina Zhurakhinskaya 2011-12-08 08:18:42 UTC
Review of attachment 201478 [details] [review]:

This approach breaks combining the tray icon and notifications from the same application under the same source. Attaching an alternative patch that uses the app name, but also uses the pid.
Comment 4 Marina Zhurakhinskaya 2011-12-08 08:21:48 UTC
Created attachment 203043 [details] [review]
notificationDaemon: group sources based on a combination of pid and title

That way different system notifications, such as the ones about battery power
and the ones about software updates, are shown with separate message tray
sources.

This patch was tested with both Software Updates and Power notifications, as
well as with a tray icon and notifications for XChat.
Comment 5 Jasper St. Pierre (not reading bugmail) 2011-12-08 21:42:16 UTC
Review of attachment 203043 [details] [review]:

::: js/ui/notificationDaemon.js
@@ +153,3 @@
     },
 
+    _lookupSource: function(title, pid, trayIcon) {

I don't like this. Just make source._pid public, and do:

    for (let sourceId in this._sources) {
        let source = this._sources[sourceId];
        if (source.title == title && source.pid == pid)
             return source;
    }

In fact, with this, we're no longer matching on a hash ID, so I'd just make this._sources into a list.
Comment 6 Marina Zhurakhinskaya 2011-12-20 05:52:17 UTC
Created attachment 203928 [details] [review]
notificationDaemon: group sources based on a combination of pid and title

That way different system notifications, such as the ones about battery power
and the ones about software updates, are shown with separate message tray
sources.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-01-03 19:24:44 UTC
Review of attachment 203928 [details] [review]:

Looks good.
Comment 8 Ionut Biru 2012-01-18 17:24:10 UTC
this change breaks skype tray icon. 

now it treats skype as a notification instead of an actual application in the tray.

it doesn't have an icon, left click doesn't do anything, right click opens the open/remove dialog and the animation when sliding the cursor left/right contains 3 skype texts.

http://pkgbuild.com/~ioni/shell-20120118-1.webm
Comment 9 Michael Laß 2012-01-18 21:02:28 UTC
I can confirm that this change breaks many tray icons, e.g. pidgin, opera, dropbox...

The icons of some applications reappear when restarting gnome-shell while these programs are running, but this isn't true for all applications. Also I can confirm that clicking on existing (or non existing) icons doesn't have any effect anymore although it should for several applications.

Reverting this change fixes the problem.
Comment 10 Owen Taylor 2012-01-19 18:03:46 UTC
Can people who are reporting problems here clarify whether they are testing with GNOME Shell 3.2.2 or the development branch?

I made a mistake in merging into the 3.2 branch which is probably responsible for the problems described, but want to make sure there aren't other problems. (In fact, I found another problem with master where it would crash after a legacy tray icon was removed.)

Will attaches patches for the mismerge and for the crash.
Comment 11 Ionut Biru 2012-01-19 18:06:34 UTC
i'm sorry for not mention at the beginning. 

is gnome-shell 3.2.2
Comment 12 Owen Taylor 2012-01-19 18:06:50 UTC
Created attachment 205649 [details] [review]
notificationDaemon: fix problem with cherry-pick to gnome-3-2

When backporting 7e654ab3ca
(notificationDaemon: group sources based on a combination of pid and title)
to old-style classes, I screwed up passing arguments to the Source
constructor.
Comment 13 Owen Taylor 2012-01-19 18:07:04 UTC
Created attachment 205650 [details] [review]
notificationDaemon: fix order of arguments to _lookupSource()

The order of arguments passed to lookupSource() was wrong, causing
problems when tray icons were removed.
Comment 14 Ionut Biru 2012-01-19 18:17:28 UTC
i just check your patches and it fixes my original problems with skype.

It will be nice to have another tester.
Comment 15 Michael Laß 2012-01-19 19:27:50 UTC
I can confirm that the patch in comment 13 applied to gnome-shell-3.2.2 solves the problem.

Thank you for this quick fix.
Comment 16 Mantas Mikulėnas (grawity) 2012-01-19 20:54:34 UTC
Applied patches #12 + #13 to gnome-shell 3.2.2; works well so far.
Comment 17 Marina Zhurakhinskaya 2012-01-20 05:00:29 UTC
Review of attachment 205650 [details] [review]:

It should be _lookupSource() in the patch description.
Comment 18 Owen Taylor 2012-01-20 05:16:13 UTC
Comment on attachment 205650 [details] [review]
notificationDaemon: fix order of arguments to _lookupSource()

Patches reviewed by Marina, pushing.
Comment 19 Owen Taylor 2012-01-20 05:24:00 UTC
Attachment 205649 [details] pushed as 7ff63a2 - notificationDaemon: fix problem with cherry-pick to gnome-3-2