[gnome-shell] MessageTray: don't forward click on sources with notifications



commit 96c2b5ef323cb73db3a3d602681e71c1a6de1327
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Mar 26 15:57:23 2011 +0100

    MessageTray: don't forward click on sources with notifications
    
    When a source has an associated tray icon, we would forward all clicks
    to the X11 window, meaning that the summary notification could not
    be opened. Instead, restore normal event flow for clicks, when the
    source has notifications in the queue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645753

 js/ui/notificationDaemon.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index c3ae212..d2a50d0 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -465,6 +465,14 @@ Source.prototype = {
         if (event.type() != Clutter.EventType.BUTTON_RELEASE)
             return false;
 
+        // Left clicks are passed through only where there aren't unacknowledged
+        // notifications, so it possible to open them in summary mode; right
+        // clicks are always forwarded, as the right click menu is not useful for
+        // tray icons
+        if (event.get_button() == 1 &&
+            this.notifications.length > 0)
+            return false;
+
         if (Main.overview.visible) {
             // We can't just connect to Main.overview's 'hidden' signal,
             // because it's emitted *before* it calls popModal()...



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