| 3 * |
3 * |
| 4 * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org> |
4 * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org> |
| 5 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> |
5 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> |
| 6 * Inspired by a similar plugin by: |
6 * Inspired by a similar plugin by: |
| 7 * John (J5) Palmieri <johnp@martianrock.com> |
7 * John (J5) Palmieri <johnp@martianrock.com> |
| 8 * |
8 * |
| 9 * This program is free software; you can redistribute it and/or |
9 * This program is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU General Public License as |
10 * modify it under the terms of the GNU General Public License as |
| 11 * published by the Free Software Foundation; either version 2 of the |
11 * published by the Free Software Foundation; either version 2 of the |
| 12 * License, or (at your option) any later version. |
12 * License, or (at your option) any later version. |
| 13 * |
13 * |
| 14 * This program is distributed in the hope that it will be useful, but |
14 * This program is distributed in the hope that it will be useful, but |
| 15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * General Public License for more details. |
17 * General Public License for more details. |
| 18 * |
18 * |
| 19 * You should have received a copy of the GNU General Public License |
19 * You should have received a copy of the GNU General Public License |
| 20 * along with this program; if not, write to the Free Software |
20 * along with this program; if not, write to the Free Software |
| 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 22 * 02111-1301, USA. |
22 * 02111-1301, USA. |
| 23 */ |
23 */ |
| 57 |
57 |
| 58 static void |
58 static void |
| 59 docklet_x11_embedded_cb(GtkWidget *widget, void *data) |
59 docklet_x11_embedded_cb(GtkWidget *widget, void *data) |
| 60 { |
60 { |
| 61 purple_debug(PURPLE_DEBUG_INFO, "docklet", "embedded\n"); |
61 purple_debug(PURPLE_DEBUG_INFO, "docklet", "embedded\n"); |
| 62 |
62 |
| 63 g_source_remove(embed_timeout); |
63 g_source_remove(embed_timeout); |
| 64 embed_timeout = 0; |
64 embed_timeout = 0; |
| 65 pidgin_docklet_embedded(); |
65 pidgin_docklet_embedded(); |
| 66 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE); |
66 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE); |
| 67 } |
67 } |
| 209 { |
209 { |
| 210 g_return_if_fail(docklet != NULL); |
210 g_return_if_fail(docklet != NULL); |
| 211 |
211 |
| 212 if (embed_timeout) |
212 if (embed_timeout) |
| 213 g_source_remove(embed_timeout); |
213 g_source_remove(embed_timeout); |
| 214 |
214 |
| 215 pidgin_docklet_remove(); |
215 pidgin_docklet_remove(); |
| 216 |
216 |
| 217 g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL); |
217 g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL); |
| 218 gtk_widget_destroy(GTK_WIDGET(docklet)); |
218 gtk_widget_destroy(GTK_WIDGET(docklet)); |
| 219 |
219 |
| 220 g_object_unref(G_OBJECT(docklet)); |
220 g_object_unref(G_OBJECT(docklet)); |
| 221 docklet = NULL; |
221 docklet = NULL; |
| 237 * loaded so that it can embed automatically if/when a notification |
237 * loaded so that it can embed automatically if/when a notification |
| 238 * area becomes available. |
238 * area becomes available. |
| 239 */ |
239 */ |
| 240 purple_debug_info("docklet", "failed to embed within timeout\n"); |
240 purple_debug_info("docklet", "failed to embed within timeout\n"); |
| 241 pidgin_docklet_remove(); |
241 pidgin_docklet_remove(); |
| 242 |
242 |
| 243 return FALSE; |
243 return FALSE; |
| 244 } |
244 } |
| 245 |
245 |
| 246 static void |
246 static void |
| 247 docklet_x11_create(gboolean recreate) |
247 docklet_x11_create(gboolean recreate) |