From: Christian Dywan Date: Sat, 25 Apr 2009 14:19:11 +0000 (+0200) Subject: Make transfer panel properly detachable X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=080bbd7eb57fcf09ca8079af0e5edc6bf86d9d13;p=midori Make transfer panel properly detachable --- diff --git a/panels/midori-transfers.c b/panels/midori-transfers.c index 6c6b1e38..b654fe3b 100644 --- a/panels/midori-transfers.c +++ b/panels/midori-transfers.c @@ -347,10 +347,13 @@ midori_transfers_hierarchy_changed_cb (MidoriTransfers* transfers, GtkWidget* old_parent) { #if WEBKIT_CHECK_VERSION (1, 1, 3) - GtkWidget* browser = gtk_widget_get_toplevel (GTK_WIDGET (transfers)); - if (GTK_WIDGET_TOPLEVEL (browser)) + MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (transfers)); + if (MIDORI_IS_BROWSER (browser)) g_signal_connect (browser, "add-download", 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 }