#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_a11y.dpatch by Jindrich Makovicka <makovick@gmail.com>
##
## DP: Fixes slow message filtering with Gnome Accessibility on

@DPATCH@

--- pan-0.135/pan/gui/header-pane.cc	2011-05-29 15:19:51.000000000 +0200
+++ pan-0.135/pan/gui/header-pane.cc	2011-11-26 19:47:17.048559385 +0100
@@ -682,7 +682,12 @@
       Row * child (get_row (it->first));
       tmp[parent].push_back (child);
     }
+
+    g_object_ref(G_OBJECT (_tree_store));
+    gtk_tree_view_set_model(GTK_TREE_VIEW(_tree_view), NULL);
     _tree_store->insert_sorted (tmp);
+    gtk_tree_view_set_model(GTK_TREE_VIEW(_tree_view), GTK_TREE_MODEL (_tree_store));
+    g_object_unref(G_OBJECT(_tree_store));
   }
      
   // reparent...
@@ -708,7 +713,12 @@
                          keep.begin(), keep.end(),
                          inserter (kill, kill.begin()), o);
     g_assert (keep.size() + kill.size() == _mid_to_row.size());
+
+    g_object_ref(G_OBJECT (_tree_store));
+    gtk_tree_view_set_model(GTK_TREE_VIEW(_tree_view), NULL);
     _tree_store->remove (kill);
+    gtk_tree_view_set_model(GTK_TREE_VIEW(_tree_view), GTK_TREE_MODEL (_tree_store));
+    g_object_unref(G_OBJECT(_tree_store));
     _mid_to_row.get_container().swap (keep);
   }
 
