Re: source.unseenCount's strange behavior



2012/10/3 Thiago Bellini Ribeiro <hackedbellini gmail com>:
> On Tue, Oct 2, 2012 at 3:50 PM, Giovanni Campagna
> <scampa giovanni gmail com> wrote:
>> It's very possible that there is a bug, as that count is used by the
>> screen lock and only for non resident notifications. It would be very
>> helpful if you could debug, or otherwise just look at
>> js/ui/screenShield.js : NotificationBox for code to filter out
>> resident sources, as I understand you don't want to show them anyway.
>
> I took a look at the screenShield's NotificationBox. The way it
> filters notifications is very close to what I'm doing: It doesn't
> consider chat notifications as resident (like I do, even though it's
> marked as resident on 'resident' flag) so maybe that's the reason it's
> masking the bug on non chat resident notifications =P
>
> The problem is that the unseenCount of resident notifications (is it
> all of them or just rhythmbox's ones?) isn't being updated. It's
> calculated by getting the number of notifications that has the
> 'acknowledged' flag set to false[1]. And it doesn't matter if I click
> on the notification icon and then dismiss it clicking directly on it
> (instead of closing at the 'x'), it'll always return 1 (where on a
> chat notification, it returns to 0 after I click it).
>
> Maybe notifications should be marked as 'acknowledged' even if they
> are resident? Or unseenCount shouldn't take resident notifications in
> consideration? It's just strange to see a notification like rhythmbox
> (that isn't supposed to be dismissed) never being acknowledged and
> it's source always saying that there is one unseen notification there.

Ok after digging a bit, the problem is that .acknowledged is only set
for notifications that are in the queue, but
(notificationDaemon.js:564) resident notifications are not queued if
the originating app is currently focused. A good fix, for which you
can prepare a patch if you want, is to mark those notifications as
immediately acknowledged, since that's the point.
All other cases, including resident notifications for background apps
(such as rhythmbox changing song), should be already covered.

Giovanni


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]