pidgin: 76222186: Apply the timer-check patch that I suppl...

qulogic at pidgin.im qulogic at pidgin.im
Tue Mar 1 01:40:57 EST 2011


----------------------------------------------------------------------
Revision: 76222186bea3c01000d2d0b46040f87ebd07afe3
Parent:   041c0031a8e0ef951364f4355453dcf5afeeda37
Author:   qulogic at pidgin.im
Date:     02/27/11 19:12:20
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/76222186bea3c01000d2d0b46040f87ebd07afe3

Changelog: 

Apply the timer-check patch that I supplied in #13139. Should now show
a docklet icon on the older GTK+.

Fixes #13139.

Changes against parent 041c0031a8e0ef951364f4355453dcf5afeeda37

  patched  ChangeLog
  patched  pidgin/gtkdocklet-gtk.c

-------------- next part --------------
============================================================
--- ChangeLog	2c5b70b071a9007aa69a4cdf5ba3cbb4a3827eab
+++ ChangeLog	b36888a89cdbb85314f6ef26087bcf432ba955dd
@@ -7,6 +7,8 @@ version 2.7.11 (??/??/????):
 	Pidgin:
 	* Sort by Status no longer causes buddies to move around when you
 	  click them.
+	* Fix embedding in the system tray on older GTK+ releases (such as on
+	  CentOS 5.5 and older Fedora).
 
 	AIM:
 	* Fix a bug where some buddies from your buddy list might not show up.
============================================================
--- pidgin/gtkdocklet-gtk.c	87b17638595b6b1ebfdf232f8cd5f7ad61bdf557
+++ pidgin/gtkdocklet-gtk.c	174469e45524ecfb6afcabdcc55bdd07664839ae
@@ -47,19 +47,37 @@ docklet_gtk_embed_timeout_cb(gpointer da
 static gboolean
 docklet_gtk_embed_timeout_cb(gpointer data)
 {
-	/* The docklet was not embedded within the timeout.
-	 * Remove it as a visibility manager, but leave the plugin
-	 * loaded so that it can embed automatically if/when a notification
-	 * area becomes available.
-	 */
-	purple_debug_info("docklet", "failed to embed within timeout\n");
-	pidgin_docklet_remove();
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
+#if !GTK_CHECK_VERSION(2,12,0)
+	if (gtk_status_icon_is_embedded(docklet)) {
+		/* Older GTK+ (<2.12) don't implement the embedded signal, but the
+		   information is still accessable through the above function. */
+		purple_debug_info("docklet", "embedded\n");
 
+		pidgin_docklet_embedded();
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", TRUE);
+	}
+	else
+#endif
+	{
+		/* The docklet was not embedded within the timeout.
+		 * Remove it as a visibility manager, but leave the plugin
+		 * loaded so that it can embed automatically if/when a notification
+		 * area becomes available.
+		 */
+		purple_debug_info("docklet", "failed to embed within timeout\n");
+		pidgin_docklet_remove();
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
+	}
+
+#if GTK_CHECK_VERSION(2,12,0)
 	embed_timeout = 0;
 	return FALSE;
+#else
+	return TRUE;
+#endif
 }
 
+#if GTK_CHECK_VERSION(2,12,0)
 static gboolean
 docklet_gtk_embedded_cb(GtkWidget *widget, gpointer data)
 {
@@ -82,6 +100,7 @@ docklet_gtk_embedded_cb(GtkWidget *widge
 
 	return TRUE;
 }
+#endif
 
 static void
 docklet_gtk_destroyed_cb(GtkWidget *widget, gpointer data)
@@ -206,7 +225,9 @@ docklet_gtk_status_create(gboolean recre
 
 	g_signal_connect(G_OBJECT(docklet), "activate", G_CALLBACK(docklet_gtk_status_activated_cb), NULL);
 	g_signal_connect(G_OBJECT(docklet), "popup-menu", G_CALLBACK(docklet_gtk_status_clicked_cb), NULL);
+#if GTK_CHECK_VERSION(2,12,0)
 	g_signal_connect(G_OBJECT(docklet), "notify::embedded", G_CALLBACK(docklet_gtk_embedded_cb), NULL);
+#endif
 	g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_gtk_destroyed_cb), NULL);
 
 	gtk_status_icon_set_visible(docklet, TRUE);
@@ -226,11 +247,15 @@ docklet_gtk_status_create(gboolean recre
 	 */
 	if (!recreate) {
 		pidgin_docklet_embedded();
+#if GTK_CHECK_VERSION(2,12,0)
 		if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded")) {
 			embed_timeout = purple_timeout_add_seconds(LONG_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
 		} else {
 			embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
 		}
+#else
+		embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
+#endif
 	}
 
 	purple_debug_info("docklet", "GTK+ created\n");


More information about the Commits mailing list