mkiol / GNotifier

Thunderbird add-on that replaces built-in notifications with the OS native notifications
https://addons.mozilla.org/thunderbird/addon/gnotifier/
GNU General Public License v3.0
164 stars 25 forks source link

[thunderbird | win10] Notification does not show in action center #65

Open marceldev89 opened 9 years ago

marceldev89 commented 9 years ago

New mail notification does show a toast but when you ignore it (as in it timeouts), it does not show the notification in the action center. As per the documentation it should. Closing or "swiping" the toast does work as intended.

I tried to fix the issue myself but with no success. Perhaps it's an issue with the C++ API's in Windows 10 but I didn't really do more than setting a few breakpoints and commenting out pieces of code.

(Tested all this with version 1.9.0)

mkiol commented 9 years ago

@kabili207 Could you please, check it? Thanks!

kabili207 commented 9 years ago

I'll dig around and see if I can figure out what's causing it.

OmegaZxA commented 8 years ago

G notifier, on my Windows 10, won't show the system toaster. I get the toast from Thunderbird's default notification system (white popup on lower-right corner), but noting in the likes fo the top-right corner system toaster.

marceldev89 commented 8 years ago

Did you try with version 1.9+? The version on the Thunderbird addon site is 1.8.9 which (probably) doesn't have the correct stuff for Thunderbird if I check the changelog.

OmegaZxA commented 8 years ago

Would you recommend testing the 191pre or 190? I didn't know the repository had it on a higher version (didn't really look into it, my bad.)

Em 21/09/2015 13:35, Marcel de Vries escreveu:

Did you try with version 1.9+? The version on the thunderbird addon site is 1.8.9 which (probably) doesn't really support Windows 10.

— Reply to this email directly or view it on GitHub https://github.com/mkiol/GNotifier/issues/65#issuecomment-142036611.

marceldev89 commented 8 years ago

I'm using 1.9.0. 1.9.1-pre only has some translation stuff updated.

kabili207 commented 8 years ago

I should probably give you an update on the action center part of this bug. My primary development machine is a Windows 8 work PC that I can't upgrade until the sysadmins approve it. My personal dev box is Win 10, but I'm usually too busy on the weekends to work on it.

That being said, I haven't managed to find any obvious reason why it's not working correctly. None of the objects are being prematurely disposed, nor is it being explicitly closed in my code. I have managed to get a notification to show in the action center by setting a delay on the notification and opening the action center quickly. However it will only stay there until it's closed. Re-opening the action center again causes it to vanish. Either there's a bug in the WRL API, or I'm missing something a lot more subtle.

OmegaZxA commented 8 years ago

The 1.9.x version is working intermitently, not displaying some mail notifications. Clicking the toaster using the minimize to tray addon does not bring thunderbird to the front, but removes the notification from the notification central.

On Firefox, it seems to be working as intended, at least for now

Em 21/09/2015 14:44, Andrew Nagle escreveu:

I should probably give you an update on the action center part of this bug. My primary development machine is a Windows 8 work PC that I can't upgrade until the sysadmins approve it. My personal dev box is Win 10, but I'm usually too busy on the weekends to work on it.

That being said, I haven't managed to find any obvious reason why it's not working correctly. None of the objects are being prematurely disposed, nor is it being explicitly closed in my code. I have managed to get a notification to show in the action center by setting a delay on the notification and opening the action center quickly. However it will only stay there until it's closed. Re-opening the action center again causes it to vanish. Either there's a bug in the WRL API, or I'm missing something a lot more subtle.

— Reply to this email directly or view it on GitHub https://github.com/mkiol/GNotifier/issues/65#issuecomment-142056051.

marceldev89 commented 8 years ago

@kabili207 I stumbled upon this a couple of weeks ago: https://stackoverflow.com/questions/31962216/unexpected-behaviours-in-toast-notification-from-desktop-app-in-windows-10 . But forgot to share.

It isn't really helpful but I guess it's a bug or difference between the C++ and Universal Apps libraries.

kabili207 commented 8 years ago

@OmegaZxA There are no click actions defined for any of the supported operating system in Thunderbird. You can check issue #35 for progress on that particular feature.

OmegaZxA commented 8 years ago

OK, thanks for the update, Andrew.

By the way, fot now, we only get toaster notifications, but no persistent notifications in the notification area tray, same for firefox (tested a few notification calling events, all of them brought toasters up, and for thunderbird, I get the same notification 3 or 4 times in rapid succession). the next step, I think, would be getting persistent notifications in the notification central.

Em 21/09/2015 14:56, Andrew Nagle escreveu:

@OmegaZxA https://github.com/OmegaZxA There are no click actions defined for any of the supported operating system in Thunderbird. You can check issue #35 https://github.com/mkiol/GNotifier/issues/35 for progress on that particular feature.

— Reply to this email directly or view it on GitHub https://github.com/mkiol/GNotifier/issues/65#issuecomment-142060891.

kabili207 commented 8 years ago

@mvries The MSDN post linked in that StackOverflow question was actually really helpful, if only to let me know the issue is indeed a bug in the C++ API. Unfortunately this means we can't really do much until Microsoft fixes it.

kabili207 commented 8 years ago

Microsoft finally posted instructions on how to put a notification in the Action Center and respond to those notifications. There are a few hurdles that will need to be handled for this to work:

  1. Create a COM server in a new EXE
  2. Create a special Toast Activator CLSID and add it to Firefox's/Thunderbird's Start Menu shortcut
  3. Create a registry key that points to the EXE to call whenever a toast we create is activated from the Action Center
  4. The EXE will have to check if Firefox/Thunderbird/etc. is running (starting if it is not) and communicate with the gnotifier shim via some sort of API
  5. Perform whatever action was defined for the toast

We need the intermediate EXE because firefox doesn't implement the required COM methods that we'll need to call. The EXE will need to know exactly what program, under which profile, created the toast and where it's EXE is located. We'll also have to create some kind of API so the EXE can inform gnotifier that an action needs performed.

The biggest problem is going to be performing whatever action we're supposed to. The COM API we're supposed to add only seems to send back string data whereas the actions in gnotifier are all javascript functions. We could maintain a mapping between a unique string value and a JS callback, but what do we do if the user closes the tab that created the notification? What if they close firefox? Certain things like file download notifications could be easy, but other scenarios are going to be harder to handle.

As much as it pains me to say it, I just simply don't have the time required to do this.

mkiol commented 8 years ago

@kabili207 Thank you so much for the analysis and detailed explanation. Indeed, it seems that a gigantic work must be done. Your decision is fully understandable.

the-nic commented 8 years ago

there is now an example at https://github.com/WindowsNotifications/desktop-toasts

kmgallahan commented 8 years ago

Just wanted to +1 this feature - it would really be great to have Thunderbird notifications show up in the new Windows 10 Action Center. I see it would take a fair bit of work though... so I just want to let you know that at least 1 more person would definitely be using the feature.

rcmero commented 7 years ago

Just wanted to leave my two cents on this issue and state that with the Anniversary Update this is made much easier. All you need to do is access the Settings app -> Notifications and select Firefox/Thunderbird. There you will find the option to display the notifications on the Action Centre.

kabili207 commented 7 years ago

That setting only enables/disables the ability to an application to show a notification, not whether or not it can show something in the Action Center. Gnotifier can't show anything in Action Center because the API Microsoft created is overcomplicated and would require a lot of annoying workarounds or changes to Thunderbird and Firefox.

tooomm commented 7 years ago

Well, Action Center somehow can show notifications from gnotifier...

Try clicking the action center logo while a notification is displayed, it'll work. But once a notification times out, it's gone and isn't collected there.

kabili207 commented 7 years ago

But once a notification times out, it's gone and isn't collected there.

Yeah, that's the problem this bug is trying to address. Any notification will show up in the Action Center. Getting it to stay there is hard part.

OmegaZxA commented 7 years ago

On 10, sometimes they stay, sometimes they vanish. It's a mistery.

tooomm commented 7 years ago

Oh, so far for me they never stay on windows 10...

rcmero commented 7 years ago

Does Thunderbird show up on the notification settings, in the Settings app? As long as the Anniversary Update is installed, I believe you can set in there for the notifications to be displayed in the Action Centre.

kabili207 commented 7 years ago

As mentioned before, Notifications created by Thunderbird and Firefox will show up in the Action Center without any change. Getting notifications that have timed out to STAY there _is not possible_ without switching to the convoluted Windows 10 API.

ssshadowww commented 7 years ago

Just wanted to say that you can go to settings -> system -> notifications -> Thunderbird -> "Show notifications in action center" = On. Notifications will now be persistent.

Perhaps it should be made clear in GNotifier that this needs to be done.

rcmero commented 7 years ago

Yes, that was what I was mentioning before. The notifications will appear slightly faded in the action centre, but that always happens with Win32 apps not built for Windows 10 (the Dropbox desktop app is a good example).

Also, as a small aside, this will require the Windows 10 Anniversary Update.