# HG changeset patch # User Sean Egan # Date 1105227624 0 # Node ID 9655389f4b8117bc38c98cbd27953cc1bb51c1dd # Parent a3a540ed25181c0bcc973b96ccaf21594b597139 [gaim-migrate @ 11781] This allows the blist to be hidden in the docklet on start. It adds a three second timeout after attempting to embed. If it doesn't embed within this time, it will assume there's no manager and give show the buddy list. Robot101 is looking into less hacky ways to do this. I doubt one exists. committer: Tailor Script diff -r a3a540ed2518 -r 9655389f4b81 plugins/docklet/docklet-x11.c --- a/plugins/docklet/docklet-x11.c Sat Jan 08 21:10:17 2005 +0000 +++ b/plugins/docklet/docklet-x11.c Sat Jan 08 23:40:24 2005 +0000 @@ -33,10 +33,13 @@ #include "eggtrayicon.h" #include "docklet.h" +#define EMBED_TIMEOUT 3000 + /* globals */ static EggTrayIcon *docklet = NULL; static GtkWidget *image = NULL; static GdkPixbuf *blank_icon = NULL; +static int embed_timeout = 0; /* protos */ static void docklet_x11_create(); @@ -53,8 +56,9 @@ docklet_x11_embedded_cb(GtkWidget *widget, void *data) { gaim_debug(GAIM_DEBUG_INFO, "tray icon", "embedded\n"); - - docklet_embedded(); + + g_source_remove(embed_timeout); + embed_timeout = 0; } static void @@ -148,7 +152,7 @@ *push_in = TRUE; } -static void +static gboolean docklet_x11_destroy() { docklet_remove(GTK_WIDGET_VISIBLE(docklet)); @@ -164,6 +168,7 @@ blank_icon = NULL; gaim_debug(GAIM_DEBUG_INFO, "tray icon", "destroyed\n"); + return FALSE; } static void @@ -197,6 +202,8 @@ /* ref the docklet before we bandy it about the place */ g_object_ref(G_OBJECT(docklet)); + docklet_embedded(); + embed_timeout = g_timeout_add(EMBED_TIMEOUT, docklet_x11_destroy, NULL); gaim_debug(GAIM_DEBUG_INFO, "tray icon", "created\n"); }