Make transfer panel properly detachable

This commit is contained in:
Christian Dywan 2009-04-25 16:19:11 +02:00
parent 90d9e85167
commit 080bbd7eb5

View file

@ -347,10 +347,13 @@ midori_transfers_hierarchy_changed_cb (MidoriTransfers* transfers,
GtkWidget* old_parent) GtkWidget* old_parent)
{ {
#if WEBKIT_CHECK_VERSION (1, 1, 3) #if WEBKIT_CHECK_VERSION (1, 1, 3)
GtkWidget* browser = gtk_widget_get_toplevel (GTK_WIDGET (transfers)); MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (transfers));
if (GTK_WIDGET_TOPLEVEL (browser)) if (MIDORI_IS_BROWSER (browser))
g_signal_connect (browser, "add-download", g_signal_connect (browser, "add-download",
G_CALLBACK (midori_transfers_browser_add_download_cb), transfers); G_CALLBACK (midori_transfers_browser_add_download_cb), transfers);
if (old_parent)
g_signal_handlers_disconnect_by_func (old_parent,
midori_transfers_browser_add_download_cb, transfers);
#endif #endif
} }