From 080bbd7eb57fcf09ca8079af0e5edc6bf86d9d13 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 25 Apr 2009 16:19:11 +0200 Subject: [PATCH] Make transfer panel properly detachable --- panels/midori-transfers.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 } -- 2.39.5