diff options
Diffstat (limited to 'debian/patches/40_unity_launcher_count.patch')
-rw-r--r-- | debian/patches/40_unity_launcher_count.patch | 289 |
1 files changed, 289 insertions, 0 deletions
diff --git a/debian/patches/40_unity_launcher_count.patch b/debian/patches/40_unity_launcher_count.patch new file mode 100644 index 000000000..d2e2e3193 --- /dev/null +++ b/debian/patches/40_unity_launcher_count.patch @@ -0,0 +1,289 @@ +=== modified file 'configure.ac' +--- old/configure.ac 2011-02-24 17:06:45 +0000 ++++ new/configure.ac 2011-02-24 17:09:26 +0000 +@@ -58,6 +58,7 @@ + GNOME_CONTROL_CENTER_GTK3_REQUIRED=2.31.4 + INDICATE_REQUIRED=0.4.91 + INDICATE_GTK_REQUIRED=0.4.91 ++UNITY_REQUIRED=3.4.0 + + # telepathy-yell + prev_top_build_prefix=$ac_top_build_prefix +@@ -506,12 +507,41 @@ + fi + + if test "x$enable_libindicate" = "xyes" -a "x$have_libindicate" != "xyes"; then +- AC_MSG_ERROR([Couldn't find libindicate.]) ++ AC_MSG_ERROR([Could not find libindicate.]) + fi + + AM_CONDITIONAL(HAVE_LIBINDICATE, test "x$have_libindicate" = "xyes") + + # ----------------------------------------------------------- ++# libunity ++# ----------------------------------------------------------- ++AC_ARG_ENABLE(libunity, ++ AS_HELP_STRING([--enable-libunity=@<:@no/yes/auto@:>@], ++ [build libunity support]), , ++ enable_libunity=auto) ++ ++if test "x$enable_unity" != "xno"; then ++ PKG_CHECK_MODULES(UNITY, ++ [ ++ unity >= $UNITY_REQUIRED ++ ], have_unity="yes", have_unity="no") ++ ++ if test "x$have_unity" = "xyes"; then ++ AC_DEFINE(HAVE_UNITY, 1, [Define if you have unity]) ++ fi ++else ++ have_unity=no ++fi ++ ++if test "x$enable_unity" = "xyes" -a "x$have_unity" != "xyes"; then ++ AC_MSG_ERROR([Could not find libunity.]) ++fi ++ ++AM_CONDITIONAL(HAVE_UNITY, test "x$have_unity" = "xyes") ++AC_SUBST([UNITY_CFLAGS]) ++AC_SUBST([UNITY_LIBS]) ++ ++# ----------------------------------------------------------- + # nautilus-sendto + # ----------------------------------------------------------- + AC_ARG_ENABLE(nautilus-sendto, +@@ -614,6 +644,7 @@ + + Features: + Message indicator support (libindicate): ${have_libindicate} ++ Unity panel support (unity).: ${have_unity} + Spell checking (enchant)....: ${have_enchant} + Display maps (libchamplain).: ${have_libchamplain} + Location awareness (Geoclue): ${have_geoclue} + +=== modified file 'src/Makefile.am' +--- old/src/Makefile.am 2011-02-24 17:04:31 +0000 ++++ new/src/Makefile.am 2011-02-24 17:09:26 +0000 +@@ -19,6 +19,7 @@ + $(CPPFLAGS_COMMON) \ + $(LIBNOTIFY_CFLAGS) \ + $(INDICATE_CFLAGS) \ ++ $(UNITY_CFLAGS) \ + $(UNIQUE_CFLAGS) \ + $(LIBCHAMPLAIN_CFLAGS) \ + $(WEBKIT_CFLAGS) \ +@@ -30,6 +31,7 @@ + $(top_builddir)/extensions/libemp-extensions.la \ + $(LIBNOTIFY_LIBS) \ + $(INDICATE_LIBS) \ ++ $(UNITY_LIBS) \ + $(UNIQUE_LIBS) \ + $(EMPATHY_LIBS) \ + $(GTK_LIBS) \ +@@ -203,6 +205,7 @@ + $(UNIQUE_LIBS) \ + $(EMPATHY_LIBS) \ + $(INDICATE_LIBS) \ ++ $(UNITY_LIBS) \ + $(LIBCHAMPLAIN_LIBS) \ + $(WEBKIT_LIBS) \ + $(NULL) + +=== modified file 'src/empathy-chat-window.c' +--- old/src/empathy-chat-window.c 2011-02-24 17:04:31 +0000 ++++ new/src/empathy-chat-window.c 2011-02-24 17:09:26 +0000 +@@ -71,6 +71,10 @@ + #define DEBUG_FLAG EMPATHY_DEBUG_CHAT + #include <libempathy/empathy-debug.h> + ++#ifdef HAVE_UNITY ++#include <unity.h> ++#endif ++ + /* Macro to compare guint32 X timestamps, while accounting for wrapping around + */ + #define X_EARLIER_OR_EQL(t1, t2) \ +@@ -96,6 +100,9 @@ + /* EmpathyChat -> EmpathyIndicator for that chat, if any */ + GHashTable *indicators; + #endif ++#ifdef HAVE_UNITY ++ UnityLauncherEntry *launcher; ++#endif + GtkTargetList *contact_targets; + GtkTargetList *file_targets; + +@@ -1308,8 +1315,19 @@ + sender, body); + g_signal_connect (indicator, "activate", + G_CALLBACK (chat_window_indicator_activate_cb), chat); +- + g_hash_table_insert (priv->indicators, chat, indicator); ++#ifdef HAVE_UNITY ++ if (priv->launcher != NULL) ++ { ++ gint count = g_hash_table_size (priv->indicators); ++ DEBUG ("unity launcher: count is now %d", count); ++ if (count > 0) ++ { ++ unity_launcher_entry_set_count (priv->launcher, count); ++ unity_launcher_entry_set_count_visible (priv->launcher, TRUE); ++ } ++ } ++#endif + } + empathy_indicator_show (indicator); + } +@@ -1326,6 +1344,25 @@ + DEBUG ("indicator is %p", indicator); + empathy_indicator_hide (indicator); + g_hash_table_remove (priv->indicators, chat); ++#ifdef HAVE_UNITY ++ if (priv->launcher != NULL) ++ { ++ gint count = g_hash_table_size (priv->indicators); ++ DEBUG ("unity launcher: count is %d", count); ++ if (count > 0) ++ { ++ DEBUG ("unity launcher: setting count to %d", count); ++ unity_launcher_entry_set_count (priv->launcher, count); ++ unity_launcher_entry_set_count_visible (priv->launcher, TRUE); ++ } else { ++ unity_launcher_entry_set_count (priv->launcher, count); ++ DEBUG ("unity launcher: hiding count"); ++ unity_launcher_entry_set_count_visible (priv->launcher, FALSE); ++ } ++ } ++#endif ++ ++ + } else { + DEBUG ("indicator is NULL, nothing to remove"); + } +@@ -1959,6 +1996,11 @@ + priv->chat_manager = NULL; + } + ++ if (priv->launcher) { ++ g_object_unref (priv->launcher); ++ priv->launcher = NULL; ++ } ++ + chat_windows = g_list_remove (chat_windows, window); + gtk_widget_destroy (priv->dialog); + +@@ -2057,6 +2099,9 @@ + priv->indicators = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, g_object_unref); + #endif ++#ifdef HAVE_UNITY ++ priv->launcher = unity_launcher_entry_get_for_desktop_id ("empathy.desktop"); ++#endif + + priv->notebook = gtk_notebook_new (); + gtk_notebook_set_group (GTK_NOTEBOOK (priv->notebook), "EmpathyChatWindow"); + +=== modified file 'src/empathy-indicator-manager.c' +--- old/src/empathy-indicator-manager.c 2011-02-24 17:06:45 +0000 ++++ new/src/empathy-indicator-manager.c 2011-02-24 17:09:26 +0000 +@@ -45,6 +45,10 @@ + #define DEBUG_FLAG EMPATHY_DEBUG_OTHER + #include <libempathy/empathy-debug.h> + ++#ifdef HAVE_UNITY ++#include <unity.h> ++#endif ++ + #define INDICATOR_LOGIN_TIMEOUT 15 + #define EMPATHY_DESKTOP_PATH DESKTOPDIR "/empathy.desktop" + +@@ -62,6 +66,9 @@ + IndicateServer *indicate_server; + GSList *indicator_events; + GHashTable *login_timeouts; ++#ifdef HAVE_UNITY ++ UnityLauncherEntry *launcher; ++#endif + } EmpathyIndicatorManagerPriv; + + typedef struct { +@@ -172,6 +179,20 @@ + g_object_unref (indicator); + priv->indicator_events = g_slist_prepend (priv->indicator_events, + indicator_event); ++#ifdef HAVE_UNITY ++ if (priv->launcher == NULL) ++ { ++ return; ++ } ++ gint count = g_slist_length (priv->indicator_events); ++ DEBUG ("unity launcher: count is %d", count); ++ if (count > 0) ++ { ++ unity_launcher_entry_set_count (priv->launcher, count); ++ unity_launcher_entry_set_count_visible (priv->launcher, TRUE); ++ } ++#endif ++ + } + + static void +@@ -195,6 +216,26 @@ + priv->indicator_events = g_slist_remove (priv->indicator_events, + indicator_event); + empathy_indicator_hide (indicator_event->indicator); ++#ifdef HAVE_UNITY ++ if (priv->launcher == NULL) ++ { ++ DEBUG ("unity launcher: launcher is NULL"); ++ return; ++ } ++ ++ gint count = g_slist_length (priv->indicator_events); ++ DEBUG ("unity launcher: count is %d", count); ++ if (count > 0) ++ { ++ DEBUG ("unity launcher: setting count to %d", count); ++ unity_launcher_entry_set_count (priv->launcher, count); ++ unity_launcher_entry_set_count_visible (priv->launcher, TRUE); ++ } else { ++ unity_launcher_entry_set_count (priv->launcher, count); ++ DEBUG ("unity launcher: hiding count"); ++ unity_launcher_entry_set_count_visible (priv->launcher, FALSE); ++ } ++#endif + return; + } + } +@@ -211,6 +252,8 @@ + + priv = GET_PRIV (manager); + ++ DEBUG ("Event updated"); ++ + for (l = priv->indicator_events; l; l = l->next) + { + IndicatorEvent *indicator_event; +@@ -305,6 +348,10 @@ + g_object_unref (priv->indicate_server); + priv->indicate_server = NULL; + } ++ if (priv->launcher) { ++ g_object_unref (priv->launcher); ++ priv->launcher = NULL; ++ } + if (priv->login_timeouts) { + g_hash_table_unref (priv->login_timeouts); + priv->login_timeouts = NULL; +@@ -379,6 +426,10 @@ + G_CALLBACK (indicate_server_activate), + manager); + ++#ifdef HAVE_UNITY ++ priv->launcher = unity_launcher_entry_get_for_desktop_id ("empathy.desktop"); ++#endif ++ + g_signal_connect (priv->event_manager, "event-added", + G_CALLBACK (indicator_manager_event_added_cb), + manager); + |