]> spindle.queued.net Git - midori/commitdiff
Make transfer panel properly detachable
authorChristian Dywan <christian@twotoasts.de>
Sat, 25 Apr 2009 14:19:11 +0000 (16:19 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 25 Apr 2009 14:19:11 +0000 (16:19 +0200)
panels/midori-transfers.c

index 6c6b1e3895d88978e97b17b2b27e02b89042d72d..b654fe3b1057861a15aa51cee2866328e38b260b 100644 (file)
@@ -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
 }