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 610494 - messagetray "obsolete" icons should go away
messagetray "obsolete" icons should go away
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-19 20:26 UTC by drago01
Modified: 2010-02-23 17:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove source icon when a corresponding window is activated (1.96 KB, patch)
2010-02-21 23:56 UTC, Florian Müllner
needs-work Details | Review
Remove source icon when a corresponding window is activated (2.15 KB, patch)
2010-02-22 23:53 UTC, Florian Müllner
committed Details | Review

Description drago01 2010-02-19 20:26:53 UTC
When showing an icon in the messagetray (ex: notification from xchat) and the user opens the app/window (xchat) by himself the icon no longer serves a purpose and should not be displayed.
Comment 1 Florian Müllner 2010-02-21 23:56:15 UTC
Created attachment 154346 [details] [review]
Remove source icon when a corresponding window is activated

Note that this patch only works for applications which have at least one open window at the time when the source is added to the summary. This may not be the case for applications in the notification area (e.g. Rhythmbox).
Comment 2 Dan Winship 2010-02-22 16:35:51 UTC
Comment on attachment 154346 [details] [review]
Remove source icon when a corresponding window is activated

You don't need to do all the work with tracking windows directly; just connect to 'changed::focus-app' on the ShellWindowTracker.

However, you should only connect once, for the whole NotificationDaemon, rather than having each source connect separately. Then the NotificationDaemon can remove the correct source, as needed. This will be simpler after bug 607375 is committed.

> Note that this patch only works for applications which have at least one open
> window at the time when the source is added to the summary. This may not be the
> case for applications in the notification area (e.g. Rhythmbox).

They're going to be handled specially at some point anyway.
Comment 3 Florian Müllner 2010-02-22 23:53:56 UTC
Created attachment 154459 [details] [review]
Remove source icon when a corresponding window is activated

(In reply to comment #2)
> However, you should only connect once, for the whole NotificationDaemon,
> rather than having each source connect separately.

OK, done.


> Then the NotificationDaemon can remove the correct source, as needed.

Here's the tricky part - NotificationDaemon does not keep track of the sources it adds, so we either have to add that, do the focus tracking in MessageTray instead, or allow removing sources by app. I went with the latter, but there should be no problem in changing to either of the other options.
Comment 4 Dan Winship 2010-02-23 17:15:38 UTC
Comment on attachment 154459 [details] [review]
Remove source icon when a corresponding window is activated

>+            if (this._sources[source].app == app) {
>+                this.removeSource(this._sources[source]);
>+                return;

remove the "return"; although the NotificationDaemon only uses a single source per app, other tray users might behave differently, and the name "removeSourceByApp" doesn't suggest "only the first one".
Comment 5 Florian Müllner 2010-02-23 17:57:57 UTC
Attachment 154459 [details] pushed as 4d43424 - Remove source icon when a corresponding window is activated