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

Update to version 0.1.12 to fix two bugs!
-- 
https://code.launchpad.net/~indicator-applet-developers/evolution-indicator/packaging/+merge/5257
Your team Indicator Applet Developers is subscribed to branch 
lp:~indicator-applet-developers/evolution-indicator/packaging.
=== modified file '.bzrignore'
--- .bzrignore	2009-02-05 10:02:31 +0000
+++ .bzrignore	2009-04-03 21:51:01 +0000
@@ -55,3 +55,4 @@
 src/liborg-freedesktop-evolution-indicator.la
 src/mail-server.lo
 src/org-freedesktop-evolution-indicator.eplug
+po/evolution-indicator.pot

=== modified file 'configure.ac'
--- configure.ac	2009-03-19 03:31:32 +0000
+++ configure.ac	2009-04-06 17:12:08 +0000
@@ -1,5 +1,5 @@
 AC_PREREQ(2.53)
-AC_INIT(evolution-indicator, 0.1.11, [])
+AC_INIT(evolution-indicator, 0.1.12, [])
 AM_INIT_AUTOMAKE()
 AC_CONFIG_SRCDIR(src/evolution-indicator.c)
 AM_CONFIG_HEADER(config.h)

=== modified file 'debian/changelog'
--- debian/changelog	2009-03-19 03:33:43 +0000
+++ debian/changelog	2009-04-06 17:12:08 +0000
@@ -1,3 +1,13 @@
+evolution-indicator (0.1.12-0ubuntu1) UNRELEASED; urgency=low
+
+  * New upstream version.
+    * Patch from Neil Patel to fix LP: #342429 that looks to X to figure
+      out if an Evolution window is open before sending notifications.
+    * Patch from Timo Jyrinki which fixes LP: #352657 where the plugin
+      was using the wrong gettext domain.
+
+ -- Ted Gould <[email protected]>  Mon, 06 Apr 2009 12:09:23 -0500
+
 evolution-indicator (0.1.11-0ubuntu1) jaunty; urgency=low
 
   * New upstream version.  Makes it so that notifications aren't

=== modified file 'po/Makefile.in.in'
--- po/Makefile.in.in	2009-02-04 17:00:43 +0000
+++ po/Makefile.in.in	2009-04-03 21:54:10 +0000
@@ -21,7 +21,7 @@
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 
-SHELL = /bin/sh
+SHELL = @SHELL@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -56,7 +56,7 @@
 
 PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
 
-USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep '^$$lang$$' $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep '^$$lang$$'`"; then printf "$$lang "; fi; done; fi)
 
 USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
 

=== modified file 'src/Makefile.am'
--- src/Makefile.am	2009-02-18 03:33:00 +0000
+++ src/Makefile.am	2009-04-03 21:54:10 +0000
@@ -10,7 +10,9 @@
 	e-shell.h \
 	evolution-indicator.c \
 	mail-server.c \
-	mail-server.h
+	mail-server.h \
+  xutils.c \
+  xutils.h
 
 liborg_freedesktop_evolution_indicator_la_LDFLAGS = \
 	-module -avoid-version	\

=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c	2009-03-19 03:27:03 +0000
+++ src/evolution-indicator.c	2009-04-06 13:52:56 +0000
@@ -44,6 +44,7 @@
 
 #include "e-shell.h"
 #include "mail-server.h"
+#include "xutils.h"
 
 #define CONF_DIR          "/apps/evolution/eplugin/evolution_indicator"
 #define ONLY_INBOX        CONF_DIR"/only_inbox"
@@ -96,7 +97,40 @@
 evolution_is_focused (void)
 {
 #define MAIL_ICON "evolution-mail"
+  static GdkScreen *screen = NULL;
+  static GdkWindow *root = NULL;
+  gboolean          res = FALSE;
+  Window            xwindow;
   
+  /* Try and do a match through X, by grabbing the current active window and
+     checking to see if it's an evolution window */
+  if (screen == NULL || root == NULL)
+  {
+    screen = gdk_screen_get_default ();
+    root = gdk_screen_get_root_window (screen);
+  }
+
+  xwindow = None;
+  res = _wnck_get_window (GDK_WINDOW_XWINDOW (root), 
+                    gdk_x11_get_xatom_by_name ("_NET_ACTIVE_WINDOW"),
+                    &xwindow);
+  if (res)
+  {
+    gchar *res_class = NULL;
+    gchar *res_name = NULL;
+
+    _wnck_get_wmclass (xwindow, &res_class, &res_name);
+
+    if (g_str_equal (res_name, "evolution"))
+    {
+      g_free (res_class);
+      g_free (res_name);
+      return TRUE;
+    }
+    g_free (res_class);
+    g_free (res_name);
+  }
+
   if (evo_shell)
   {
     GList *w;
@@ -161,7 +195,7 @@
       notification = notify_notification_new (" ", " ", "mail-unread", NULL);
     }
 
-    trans = g_dngettext (NULL, 
+    trans = g_dngettext (PACKAGE, 
                          _("%d New Message"), 
                          _("%d New Messages"),
                          message_count);
@@ -442,6 +476,10 @@
 	if (data->old)
     return data->old;
 
+  bindtextdomain(PACKAGE, "/usr/share/locale");
+  bind_textdomain_codeset(PACKAGE, "UTF-8");
+  textdomain(PACKAGE);
+
   frame = data->parent;
   while (!GTK_IS_FRAME (frame))
   {

=== added file 'src/xutils.c'
--- src/xutils.c	1970-01-01 00:00:00 +0000
+++ src/xutils.c	2009-04-03 21:48:09 +0000
@@ -0,0 +1,124 @@
+/* Xlib utils */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Updated to work without libwnck by Neil J.Patel <[email protected]>
+ */
+
+#include "xutils.h"
+
+gboolean 
+_wnck_get_window (Window xwindow, Atom atom, Window *val)
+{
+  Atom type;
+  int format;
+  gulong nitems;
+  gulong bytes_after;
+  Window *w;
+  int err, result;
+   
+  *val = 0;
+ 
+  gdk_error_trap_push ();
+  type = None;
+  result = XGetWindowProperty (gdk_display,
+                               xwindow,
+                               atom,
+                               0, G_MAXLONG,
+                               False, XA_WINDOW, &type, &format, &nitems,
+                               &bytes_after, (void*)&w);
+  err = gdk_error_trap_pop ();
+  if (err != Success || result != Success)
+    return FALSE;
+
+  if (type != XA_WINDOW)
+  {
+    XFree (w);
+    return FALSE;
+  }
+ 
+  *val = *w;
+ 
+  XFree (w);
+   
+  return TRUE; 
+}
+
+static char*
+latin1_to_utf8 (const char *latin1)
+{
+  GString *str;
+  const char *p;
+
+  str = g_string_new (NULL);
+
+  p = latin1;
+  while (*p)
+    {
+      g_string_append_unichar (str, (gunichar) *p);
+      ++p;
+    }
+
+  return g_string_free (str, FALSE);
+}
+
+void
+_wnck_get_wmclass (Window xwindow,
+                   char **res_class,
+                   char **res_name)
+{
+  XClassHint ch;
+  char *retval;
+
+  gdk_error_trap_push ();
+
+  ch.res_name = NULL;
+  ch.res_class = NULL;
+
+  XGetClassHint (gdk_display, xwindow,
+                 &ch);
+
+  gdk_error_trap_pop ();
+
+  retval = NULL;
+
+  if (res_class)
+    *res_class = NULL;
+
+  if (res_name)
+    *res_name = NULL;
+
+  if (ch.res_name)
+    {
+      if (res_name)
+        *res_name = latin1_to_utf8 (ch.res_name);
+
+      XFree (ch.res_name);
+    }
+
+  if (ch.res_class)
+    {
+      if (res_class)
+        *res_class = latin1_to_utf8 (ch.res_class);
+
+      XFree (ch.res_class);
+    }
+}
+
+

=== added file 'src/xutils.h'
--- src/xutils.h	1970-01-01 00:00:00 +0000
+++ src/xutils.h	2009-04-03 21:48:09 +0000
@@ -0,0 +1,31 @@
+/* Xlib utils */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+
+gboolean _wnck_get_window (Window xwindow, Atom atom, Window *val);
+
+void     _wnck_get_wmclass (Window xwindow, char **res_class, char **res_name);
+

_______________________________________________
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