pidgin: dcc3c3a8: Remove the dependency on libstartup-noti...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sat Mar 5 22:15:27 EST 2011


----------------------------------------------------------------------
Revision: dcc3c3a8e9e0b20c1df07ac43e93d6c3c1030c17
Parent:   0d73552ca01af09d2e31fb19d7d65fc39b3f133d
Author:   davidben at mit.edu
Date:     03/05/11 22:10:40
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/dcc3c3a8e9e0b20c1df07ac43e93d6c3c1030c17

Changelog: 

Remove the dependency on libstartup-notification.  Our use of it had some bugs
and we don't need it anyway, as GTK+ has included startup notification support
since their 2.2.0.  Fixes #13245.

Changes against parent 0d73552ca01af09d2e31fb19d7d65fc39b3f133d

  patched  configure.ac
  patched  pidgin/Makefile.am
  patched  pidgin/gtkdialogs.c
  patched  pidgin/gtkmain.c

-------------- next part --------------
============================================================
--- configure.ac	2753c631d7dec5c5184277e36d3999d7d931b423
+++ configure.ac	bb7306b67eca82d0f0777179a09a49a3641a4d28
@@ -541,27 +541,6 @@ Use --disable-sm if you do not need sess
 	fi
 
 	dnl #######################################################################
-	dnl # Check for startup notification
-	dnl #######################################################################
-	if test "x$enable_startup_notification" = "xyes"; then
-		PKG_CHECK_MODULES(STARTUP_NOTIFICATION, [libstartup-notification-1.0 >= 0.5], , [
-			AC_MSG_RESULT(no)
-			enable_startup_notification="no"
-			if test "x$force_deps" = "xyes" ; then
-				AC_MSG_ERROR([
-Startup notification development headers not found.
-Use --disable-startup-notification if you do not need it.
-])
-			fi])
-
-		if test "x$enable_startup_notification" = "xyes"; then
-			AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
-			AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
-			AC_SUBST(STARTUP_NOTIFICATION_LIBS)
-		fi
-	fi
-
-	dnl #######################################################################
 	dnl # Check for GtkSpell
 	dnl #######################################################################
 	if test "x$enable_gtkspell" = "xyes" ; then
============================================================
--- pidgin/gtkdialogs.c	fa8956a4b102aaf7b0e393c31fe293e67ed05b48
+++ pidgin/gtkdialogs.c	0d5dfdb0fa58a94b23f46e7f90d69dce1d42af6b
@@ -650,14 +650,6 @@ else
 else
 	g_string_append(str, "    <b>Perl:</b> Disabled<br/>");
 
-#ifndef _WIN32
-#ifdef HAVE_STARTUP_NOTIFICATION
-	g_string_append(str, "    <b>Startup Notification:</b> Enabled<br/>");
-#else
-	g_string_append(str, "    <b>Startup Notification:</b> Disabled<br/>");
-#endif
-#endif
-
 if (purple_plugins_find_with_id("core-tcl") != NULL) {
 	g_string_append(str, "    <b>Tcl:</b> Enabled<br/>");
 #ifdef HAVE_TK
============================================================
--- pidgin/gtkmain.c	b58661443d35eb2407fcabcd11690e2ccf4daee6
+++ pidgin/gtkmain.c	2ddda6f732ef7bde66e305cbbc7bad80da2a3484
@@ -76,19 +76,7 @@
 
 #include <getopt.h>
 
-#ifdef HAVE_STARTUP_NOTIFICATION
-# define SN_API_NOT_YET_FROZEN
-# include <libsn/sn-launchee.h>
-# include <gdk/gdkx.h>
-#endif
 
-
-
-#ifdef HAVE_STARTUP_NOTIFICATION
-static SnLauncheeContext *sn_context = NULL;
-static SnDisplay *sn_display = NULL;
-#endif
-
 #ifdef HAVE_SIGNAL_H
 
 /*
@@ -472,42 +460,6 @@ show_usage(const char *name, gboolean te
 	g_free(text);
 }
 
-#ifdef HAVE_STARTUP_NOTIFICATION
-static void
-sn_error_trap_push(SnDisplay *display, Display *xdisplay)
-{
-	gdk_error_trap_push();
-}
-
-static void
-sn_error_trap_pop(SnDisplay *display, Display *xdisplay)
-{
-	gdk_error_trap_pop();
-}
-
-static void
-startup_notification_complete(void)
-{
-	Display *xdisplay;
-
-	xdisplay = GDK_DISPLAY();
-	sn_display = sn_display_new(xdisplay,
-								sn_error_trap_push,
-								sn_error_trap_pop);
-	sn_context =
-		sn_launchee_context_new_from_environment(sn_display,
-												 DefaultScreen(xdisplay));
-
-	if (sn_context != NULL)
-	{
-		sn_launchee_context_complete(sn_context);
-		sn_launchee_context_unref(sn_context);
-
-		sn_display_unref(sn_display);
-	}
-}
-#endif /* HAVE_STARTUP_NOTIFICATION */
-
 /* FUCKING GET ME A TOWEL! */
 #ifdef _WIN32
 /* suppress gcc "no previous prototype" warning */
@@ -876,6 +828,7 @@ int main(int argc, char *argv[])
 		dbus_connection_send_with_reply_and_block(conn, message, -1, NULL);
 		dbus_message_unref(message);
 #endif
+		gdk_notify_startup_complete();
 		purple_core_quit();
 		g_printerr(_("Exiting because another libpurple client is already running.\n"));
 #ifdef HAVE_SIGNAL_H
@@ -967,9 +920,10 @@ int main(int argc, char *argv[])
 		g_list_free(active_accounts);
 	}
 
-#ifdef HAVE_STARTUP_NOTIFICATION
-	startup_notification_complete();
-#endif
+	/* GTK clears the notification for us when opening the first window,
+	 * but we may have launched with only a status icon, so clear the it
+	 * just in case. */
+	gdk_notify_startup_complete();
 
 #ifdef _WIN32
 	winpidgin_post_init();
============================================================
--- pidgin/Makefile.am	6e2668094090aad6c6d3544ae1357ba62b021892
+++ pidgin/Makefile.am	f1f60a27a7796e0824aee31a3b2162b82724b406
@@ -156,7 +156,6 @@ pidgin_LDADD = \
 	$(SM_LIBS) \
 	$(INTLLIBS) \
 	$(GTKSPELL_LIBS) \
-	$(STARTUP_NOTIFICATION_LIBS) \
 	$(LIBXML_LIBS) \
 	$(GTK_LIBS) \
 	$(top_builddir)/libpurple/libpurple.la
@@ -180,7 +179,6 @@ AM_CPPFLAGS = \
 	$(GTK_CFLAGS) \
 	$(DBUS_CFLAGS) \
 	$(GTKSPELL_CFLAGS) \
-	$(STARTUP_NOTIFICATION_CFLAGS) \
 	$(LIBXML_CFLAGS) \
 	$(INTGG_CFLAGS)
 endif  # ENABLE_GTK


More information about the Commits mailing list