mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
Fix #182, the notifications don't work due to a quirk in the Windows API.
This commit is contained in:
parent
6e7a911477
commit
9c31b90021
1 changed files with 12 additions and 3 deletions
|
@ -81,10 +81,19 @@ namespace GreenshotWin10Plugin
|
||||||
}
|
}
|
||||||
// Prepare the toast notifier. Be sure to specify the AppUserModelId on your application's shortcut!
|
// Prepare the toast notifier. Be sure to specify the AppUserModelId on your application's shortcut!
|
||||||
var toastNotifier = DesktopNotificationManagerCompat.CreateToastNotifier();
|
var toastNotifier = DesktopNotificationManagerCompat.CreateToastNotifier();
|
||||||
if (toastNotifier.Setting != NotificationSetting.Enabled)
|
|
||||||
|
// Here is an interesting article on reading the settings: https://www.rudyhuyn.com/blog/2018/02/10/toastnotifier-and-settings-careful-with-non-uwp-applications/
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Log.DebugFormat("Ignored toast due to {0}", toastNotifier.Setting);
|
if (toastNotifier.Setting != NotificationSetting.Enabled)
|
||||||
return;
|
{
|
||||||
|
Log.DebugFormat("Ignored toast due to {0}", toastNotifier.Setting);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Log.Info("Ignoring exception as this means that there was no stored settings.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a toast XML template
|
// Get a toast XML template
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue