Ted Gould has proposed merging 
lp:~indicator-applet-developers/evolution-indicator/packaging into 
lp:~ubuntu-core-dev/evolution-indicator/ubuntu.

Requested reviews:
    Ubuntu Sponsors for main (ubuntu-main-sponsors): sponsoring

Brings in a simple patch to make it so that notifications don't appear if the 
Evolution windows are in focus.
-- 
https://code.launchpad.net/~indicator-applet-developers/evolution-indicator/packaging/+merge/4647
Your team Indicator Applet Developers is subscribed to branch 
lp:~indicator-applet-developers/evolution-indicator/packaging.
=== modified file 'configure.ac'
--- configure.ac	2009-03-15 12:05:59 +0000
+++ configure.ac	2009-03-19 03:31:32 +0000
@@ -1,5 +1,5 @@
 AC_PREREQ(2.53)
-AC_INIT(evolution-indicator, 0.1.10, [])
+AC_INIT(evolution-indicator, 0.1.11, [])
 AM_INIT_AUTOMAKE()
 AC_CONFIG_SRCDIR(src/evolution-indicator.c)
 AM_CONFIG_HEADER(config.h)

=== modified file 'debian/changelog'
--- debian/changelog	2009-03-17 09:45:52 +0000
+++ debian/changelog	2009-03-19 03:33:43 +0000
@@ -1,3 +1,10 @@
+evolution-indicator (0.1.11-0ubuntu1) jaunty; urgency=low
+
+  * New upstream version.  Makes it so that notifications aren't
+    sent if the Evolution windows have focus.  (LP: #342429)
+
+ -- Ted Gould <[email protected]>  Wed, 18 Mar 2009 22:31:34 -0500
+
 evolution-indicator (0.1.10-0ubuntu1) jaunty; urgency=low
 
   [ Ted Gould ]

=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c	2009-03-09 13:56:49 +0000
+++ src/evolution-indicator.c	2009-03-19 03:27:03 +0000
@@ -51,6 +51,7 @@
 #define SHOW_BUBBLE       CONF_DIR"/show_bubble"
 #define SHOW_NEW_IN_PANEL CONF_DIR"/show_new_messages_in_panel"
 
+static EShell       *evo_shell   = NULL;
 static MailServer   *mail_server = NULL;
 static GStaticMutex  mlock       = G_STATIC_MUTEX_INIT;
 static GConfClient  *client      = NULL;
@@ -91,6 +92,31 @@
 	return vbox;
 }
 
+static gboolean
+evolution_is_focused (void)
+{
+#define MAIL_ICON "evolution-mail"
+  
+  if (evo_shell)
+  {
+    GList *w;
+    
+    for (w = evo_shell->priv->windows; w; w = w->next)
+    {
+      GtkWindow *window = w->data;
+
+      if (GTK_IS_WINDOW (window))
+      {
+        if (gtk_window_is_active (GTK_WINDOW (window)))
+        {
+          return TRUE;
+        }
+      }
+    }
+  }
+  return FALSE;
+}
+
 void
 org_gnome_mail_new_notify (EPlugin *ep, EMEventTargetFolder *t)
 {
@@ -105,6 +131,12 @@
     return;
   }
 
+  if (evolution_is_focused ())
+  {
+    g_debug ("Evolution is focused");
+    return;
+  }
+
 	g_static_mutex_lock (&mlock);
 
   g_debug ("EI:mail_new_notify");
@@ -366,6 +398,7 @@
 {
   g_debug ("EI: SHELL STARTUP");
   
+  evo_shell = t->shell;
   mail_server_set_e_shell (mail_server_get_default (), t->shell);
 }
 

_______________________________________________
Mailing list: https://launchpad.net/~dx-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dx-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to