From 11a101815479554f1d45104f97b7c173e5076a2c Mon Sep 17 00:00:00 2001 From: Chow Loong Jin Date: Mon, 14 Nov 2011 01:31:02 +0800 Subject: [PATCH] Use GetEntryAssembly() to derive app_name This fixes an issue where notify-sharp users (e.g. Banshee) which use one of the Notification constructors that accept arguments end up sending an app_name of "notify-sharp" to notification daemons, which causes issues between Banshee and GNOME Shell where notifications are concerned. (bgo#656533 and lp#825769) --- src/Notification.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Notification.cs b/src/Notification.cs index 09ef83e..f532bf8 100644 --- a/src/Notification.cs +++ b/src/Notification.cs @@ -112,7 +112,12 @@ private struct ActionTuple { nf.NotificationClosed += OnClosed; nf.ActionInvoked += OnActionInvoked; - this.app_name = Assembly.GetCallingAssembly().GetName().Name; + Assembly app_asm = Assembly.GetEntryAssembly(); + + if (app_asm == null) + app_asm = Assembly.GetCallingAssembly(); + + this.app_name = app_asm.GetName().Name; } public Notification (string summary, string body) : this () {