Version: (using KDE KDE 3.2.92) Installed from: Gentoo Packages Compiler: GCC 3.3.3 OS: Linux I have kmail set up with two different IMAP accounts. When mail comes in for my second account, it behaves as normal (the tray updates to the number of unread messages instantly). It doesn't seem to update properly for my primary account though. The icon remains unchanged until I click on it. As soon as I do that (when there are unread messages) it updates and the kmail window opens with the unread messages already waiting. It appears as though kmail is correctly checking and updating my inbox, but not the tray icon. I've checked all the settings, and they seem to be exactly the same between the two accounts, aside from the login information. Both are being checked on a regular interval, etc. Expected behavior: Tray icon should update for all IMAP accounts, or allow the user to specify which inbox to report.
As I apparently missed the field for it, this is kmail version 1.6.82.
It's still the same behavior in KDE 3.3RC2. I leave kmail running all the time and it updates it's new message count correctly but the systray icon is only updated if I either click on the first unread message or click on the icon to minimize kmail and then click again to restore it. In case it helps this was working correctly in KDE 3.2.3, it's broken in 3.3RC2.
I can confirm this, look at my comment at Bug 87510.
An update to the bug. I use KDE 3.3 now with two imap accounts and I noticed the following. If I select the inbox of one of the accounts the tray icon shows the number of unread messages in the OTHER account's inbox (and updates it accordingly). If I select the other account's inbox it correctly shows and updates the number of unread messages in the FIRST account's inbox. Now, if I select some other folder (for instance the inbox from "Local Folders" which is empty) it shows and updates the number of unread messages from BOTH accounts correctly! I hope this gives a clue to the developers. It looks as if the calculation of unread messages for the tray icon doesn't include the currently open folder or something like that.
I think I'm seeing the same bug, but with one IMAP account. My experience is that if I have an IMAP folder open (I have several), the new mails arriving into that folder are excluded from the number shown on the tray icon.
I have exactly the same problem... KDE 3.3, SuSE RPMS, 2 (s)IMAP accounts.
Same problem here. More general, a folder is not updated in the tray when that folder has the focus in kmail.
Funny, I see an opposite (in a way) problem, but it is a bit unrelated. The tray icon shows the number of unread mails in one particular folder for a second when the icon is clicked, before the main window is restored (i.e., icon shows 51 (correctly), I click the icon, the icon shows 2 while the the window is being restored, the icon shows 51 again).
I can confirm comment 8. In my case the tray icon shows the number of unread messages in the inbox only and not all unread messages. This happens only for a second after I clicked the systray icon.
*** This bug has been confirmed by popular vote. ***
*** Bug 87510 has been marked as a duplicate of this bug. ***
Created attachment 10132 [details] Correctly update kmail systray by calling foldersChanged
I added a patch which will call "foldersChanged()" to update the tray icon. When new mail arrives at a folder which has focus (see my previous comment) it's not updated in the tray. When opening KMail the tray icon is updated just fine so we need to fake "foldersChanged" too just as is done in "showKMail()"
Wilco, I assume your patch fixes things for you? Can anyone else try the patch and confirm, please?
Well I was a little premature submitting the patch. The tray icon now flashes spastically sometimes or sometimes crashes. I think the problem is not inside the tray code.
Problem still exists in KDE 3.4 (KMail 1.8). As said before, it worked without any problems before KDE 3.3.
Created attachment 10701 [details] Patch to fix the systray icon updating correctly I think this patch should fix this issue now. Basically imapFolder->processNewMail() is not currently being called if the folder is being viewed (selected). The patch fixes this behaviour and my tray icon now updates correctly. Let's have some testers please, and hopefully this bug can be closed.
The patch seems to cause the unread numbers to not be updated when a message becomes read. I hope to have a new patch soon. Bare with me :)
Created attachment 10713 [details] A fix without side effects The root of the problem seemed to be that a 'numUnreadMsgsChanged' was not being emitted because of the code not calling processNewMail() for the folder that's currently being viewed. The new patch adds an emit in the code that gets executed for the currently viewed folder. Again, testers welcome :) (This time I'm more certain there are no side effects)
Created attachment 10763 [details] Modified version of last patch Fixes tray icon's unread message count not updating properly
Above patch committed last night. Having to manually close bug coz my cvs skills are obviously not totally mastered yet :)
The bug isn't fixed for me, is this patch already included in KDE 3.4.1? I'm using KMail 1.8.1 with KDE 3.4.1, and the problem still exists. As Wilco said in Comment #7, it only occurs if the focus is on the folder where new mail arrives. If the focus is on another folder, e.g. "sent mails", the tray is updated correctly. Sound notification works even if the inbox folder has the focus.
Well Joerg, I noticed the patch from Rich Birch isn't included in the new Kmail so you could manually try to patch it, if you're compiling from source.
please backport this patch to 3.4.2
*** Bug 96933 has been marked as a duplicate of this bug. ***
ok another problem here with attachement #10763, the tray is updated correctly but sometimes the folders don't show any new message count until i fetch new messages again. attachement #10713 works fine though
I can confirm attachment #10763 [details] works fine for me. Too bad it hasn't been included in 3.4.2 already