Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-power-manager/ChangeLog,v
retrieving revision 1.670.2.14
diff -u -r1.670.2.14 ChangeLog
--- ChangeLog	29 Sep 2006 22:42:09 -0000	1.670.2.14
+++ ChangeLog	10 Oct 2006 20:11:01 -0000
@@ -1,3 +1,12 @@
+2006-10-10  Richard Hughes <richard@hughsie.com>
+
+	* configure.in:
+	* src/gpm-tray-icon.c: (libnotify_event):
+	Detect a new enough libnotify and enable the pointing code if new
+	enough. This fixes #356431
+	Distros should comment this check out if libnotify 0.4.2 has been
+	patched from CVS.
+
 2006-09-29  Richard Hughes  <richard@hughsie.com>
 
 	* configure.in: Post release bump to 2.16.2
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-power-manager/configure.in,v
retrieving revision 1.140.2.3
diff -u -r1.140.2.3 configure.in
--- configure.in	29 Sep 2006 22:42:09 -0000	1.140.2.3
+++ configure.in	10 Oct 2006 20:11:01 -0000
@@ -47,6 +47,7 @@
 DBUS_REQUIRED=0.60
 LIBGLADE_REQUIRED=2.5.0
 LIBNOTIFY_REQUIRED=0.3.0
+LIBNOTIFY_SUGGESTED=0.4.3
 LIBWNCK_REQUIRED=2.10.0
 CAIRO_REQUIRED=1.0.0
 
@@ -250,6 +251,17 @@
 fi
 
 dnl ---------------------------------------------------------------------------
+dnl - Is a new libnotify available (i.e. has a fix for GtkStatusIcon support)?
+dnl ---------------------------------------------------------------------------
+if $PKG_CONFIG --atleast-version $LIBNOTIFY_SUGGESTED libnotify; then
+   have_libnotify_new=yes
+   AC_DEFINE(HAVE_LIBNOTIFY_NEW, 1, [Building with libnotify with GtkStatusIcon support]) 
+else
+   have_libnotify_new=no
+fi
+AM_CONDITIONAL([HAVE_LIBNOTIFY_NEW], [test $have_libnotify_new = yes])
+
+dnl ---------------------------------------------------------------------------
 dnl - Some utility functions to make checking for X things easier.
 dnl ---------------------------------------------------------------------------
 
@@ -491,3 +503,19 @@
         dbus-1 services dir:       $DBUS_SERVICES_DIR
 	gconf-schema dir:          $GCONF_SCHEMA_FILE_DIR
 "
+
+dnl ---------------------------------------------------------------------------
+dnl - Warnings
+dnl ---------------------------------------------------------------------------
+
+if test "$have_libnotify_new" = "no" ; then
+   echo "*************************************************"
+   echo "**            BIG LIBNOTIFY WARNING            **"
+   echo "*************************************************"
+   echo "You have an old version of libnotify that has a buggy version of"
+   echo "notify_notification_new_with_status_icon ()"
+   echo
+   echo "Notifications will be shown in the default location and will"
+   echo "not point to the icon."
+   echo
+   fi
Index: src/gpm-tray-icon.c
===================================================================
RCS file: /cvs/gnome/gnome-power-manager/src/gpm-tray-icon.c,v
retrieving revision 1.51.2.1
diff -u -r1.51.2.1 gpm-tray-icon.c
--- src/gpm-tray-icon.c	25 Aug 2006 18:51:49 -0000	1.51.2.1
+++ src/gpm-tray-icon.c	10 Oct 2006 20:11:03 -0000
@@ -797,9 +797,17 @@
 	if (icon->priv->is_visible) {
 		point = icon->priv->image;
 	}
-#endif
 	icon->priv->notify = notify_notification_new (title, content,
 						      msgicon, point);
+/* DISTROS: If you've patched your libnotify 0.4.2 package you can remove this check */
+#elif HAVE_LIBNOTIFY_NEW
+	icon->priv->notify = notify_notification_new_with_status_icon (title, content,
+								       msgicon, icon->priv->status_icon);
+#else
+	/* we can't point because of a bug in libnotify. Need dependency on 0.4.3 */
+	icon->priv->notify = notify_notification_new (title, content,
+						      msgicon, NULL);
+#endif
 
 	notify_notification_set_timeout (icon->priv->notify, timeout * 1000);
 
