-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix activation not writing to pipe #15
base: master
Are you sure you want to change the base?
Conversation
Mirror of https://invent.kde.org/libraries/snoretoast |
I thx for reporting. |
No worries, let me know if there's anything I can fix up, and if you'd rather me reopen this on the KDE gitlab instead. |
Waiting for merging :) Could I get detail information for snoretoast build? I tried cmake it, and open with latest visual studio but didn't work. |
(pick one or the other between angle brackets) This is what's been working for me, with just Visual Studio Build Tools 2019 with the C++ workload. |
Thank you! I'll try. |
I haven't forgotten it... just work.. life and stuff 😅 |
what's the status of this? I'm waiting for this also in context with issue in node-notifier |
From memory, you must pass a valid app ID, otherwise Windows refuses to include any controls in the notification at all, for whatever reason. |
Ok could you fill in some steps to reproduce? |
Without an appID it works ok, SnoreToast register itself and the response from the pipe on button clicks works as intended But if you specify a valid appID - the response from button clicks (=which one was clicked) is missing it appears that data is not being returned over the pipe. None of the pipe's events actually fire when an appID is specified and a button is clicked. SnoreToast does however know the a button has been clicked and the exit code is correct. Anyways this PR fixes the problem for me |
I know a real AppUserModelID is required for buttons to show up, but I think you might be able to try with the activate case anyway, as long as you pass some string to This is basically what is happening in the original downstream issue I ran into mikaelbr/node-notifier#332, where the node library passes those args on the command line and (should) emit pipe messages back to JavaScript. |
Any update guys? This fix will help a lot |
@TheOneRing Happy new year Could you give us a present for the new year? merge this fix and release a new version? 🥺 Its been almost a year since this PR was created.. |
Hm I gave it another look and the main problem now is that if the app is correctly registered we will receive two callbacks. For the detection: the first time we run we could use snoretoast/src/snoretoasts.cpp Line 546 in 17f88b2
In order to detect whether an app id is registered I tried IApplicationActivationManager->ActivateApplication but it appears that only works with applications installed from the store.
Btw, with this patch it appears that we can only receive a As snoretoast can be used to install the shortcut, I'd rather suggest that the caller of the app calls -install on startup. PS: to reproduce the issue I used the python example and removed the install step snoretoast/examples/python/snoretoast.py Line 46 in 17f88b2
|
The issue is probably fixed on master. |
from my small testing using node-notifier - the issue is not fixed in the binaries you posted, while compiling using this patch does fix the issue |
In that case please modify the python example in to a minimum reproducible. |
I think this commit might have fixed the issue: |
I noticed this while using
node-notifier
, which uses the pipe functionality to receive the response. This worked for dismissing and timeout, and for activation via the background callback. However, in the case where the app shortcut isn't installed via snoretoast, there is no background callback registered so we need to rely on the normal activation event handler, which never wrote to the pipe.I've taken a shot at fixing this by writing the action to the pipe, including the button for click events. I didn't test text entry, it may need another extra value too.