[geary: 1/2] Don't use notification action under Unity



commit f5cd06395cf44d53b4dd9f7550864e848d6512a4
Author: Khurshid Alam <sunnysigara+github gmail com>
Date:   Sun Jul 21 07:18:04 2019 +0000

    Don't use notification action under Unity
    
    Geary already adds a notification-action in the messeging menu.
    https://gitlab.gnome.org/GNOME/geary/issues/408

 src/client/notification/notification-desktop.vala | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/client/notification/notification-desktop.vala 
b/src/client/notification/notification-desktop.vala
index 20876bd8..6bff58ec 100644
--- a/src/client/notification/notification-desktop.vala
+++ b/src/client/notification/notification-desktop.vala
@@ -186,13 +186,22 @@ public class Notification.Desktop : Geary.BaseObject {
         notification.set_icon(
             new GLib.ThemedIcon("%s-symbolic".printf(GearyApplication.APP_ID))
         );
-        if (action != null) {
-            notification.set_default_action_and_target_value(
-                action, action_target
-            );
+
+        /* We do not show notification action under Unity */
+
+        if (this.application.config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
+            this.application.send_notification(id, notification);
+            return notification;
+        } else {
+            if (action != null) {
+                notification.set_default_action_and_target_value(
+                    action, action_target
+                );
+            }
+
+            this.application.send_notification(id, notification);
+            return notification;
         }
-        this.application.send_notification(id, notification);
-        return notification;
     }
 
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]