Mercurial > pidgin
diff plugins/docklet/docklet-x11.c @ 10491:9655389f4b81
[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 <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 08 Jan 2005 23:40:24 +0000 |
parents | ec140184437b |
children | 1a97d5e88d12 |
line wrap: on
line diff
--- 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"); }