renderer = gtk_cell_renderer_text_new ();
process_list->renderer = renderer;
- gint vertical_separator;
- gint tree_line_width;
- gtk_widget_style_get (GTK_WIDGET (process_list->process_list_widget),
- "vertical-separator", &vertical_separator,
- "tree-line-width", &tree_line_width,
- NULL);
- gtk_cell_renderer_get_size(renderer,
- GTK_WIDGET(process_list->process_list_widget),
- NULL,
- NULL,
- NULL,
- NULL,
- &process_list->cell_height);
+ /* Add a temporary row to the model to get the cell size when the first
+ * real process is added. */
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ path = gtk_tree_path_new_first();
+ gtk_tree_model_get_iter (gtk_tree_view_get_model(GTK_TREE_VIEW(process_list->process_list_widget)), &iter, path);
+ gtk_list_store_append(process_list->list_store, &iter);
- process_list->cell_height += vertical_separator;
- process_list->cell_height += tree_line_width;
+ process_list->cell_height = 0; // not ready to get size yet.
column = gtk_tree_view_column_new_with_attributes ( "Process",
renderer,
hashed_process_data->x.under_marked = FALSE;
hashed_process_data->next_good_time = ltt_time_zero;
+ if (process_list->cell_height == 0) {
+ GtkTreePath *path;
+ GdkRectangle rect;
+ GtkTreeIter iter;
+
+ path = gtk_tree_path_new_first();
+ gtk_tree_model_get_iter (gtk_tree_view_get_model(GTK_TREE_VIEW(process_list->process_list_widget)), &iter, path);
+ gtk_tree_view_get_background_area(
+ GTK_TREE_VIEW(process_list->process_list_widget),
+ path, NULL, &rect);
+ gtk_list_store_remove(process_list->list_store, &iter);
+ gtk_tree_path_free (path);
+ process_list->cell_height = rect.height;
+ }
+
/* Add a new row to the model */
gtk_list_store_append ( process_list->list_store,
&hashed_process_data->y_iter);
(gpointer)hashed_process_data);
process_list->number_of_process++;
+#if 0
+ GtkTreePath *path;
+ GdkRectangle rect;
+ gtk_widget_queue_draw(process_list->process_list_widget);
+ path = gtk_tree_path_new_first();
+ gtk_tree_view_get_background_area(GTK_TREE_VIEW(process_list->process_list_widget),
+ path, NULL, &rect);
+ gtk_tree_path_free (path);
+ process_list->cell_height = rect.height;
+#endif //0
- hashed_process_data->height = process_list->cell_height;
+ hashed_process_data->height = process_list->cell_height;
g_assert(hashed_process_data->height != 0);
*height = hashed_process_data->height * process_list->number_of_process;
/* Redraw has +20 priority. We want to let the redraw be done while we do
* our job. Mathieu : test with high prio higher than events for better
* scrolling. */
- //g_idle_add_full((G_PRIORITY_HIGH_IDLE + 21),
- g_idle_add_full((G_PRIORITY_DEFAULT + 2),
+ /* Mathieu, 2008 : ok, finally, the control flow view needs the cell updates
+ * to come soon enough so we can have one active cell to get the pixmap
+ * buffer height from. Therefore, let the gdk events run before the events
+ * requests.
+ */
+ g_idle_add_full((G_PRIORITY_HIGH_IDLE + 21),
+ //g_idle_add_full((G_PRIORITY_DEFAULT + 2),
(GSourceFunc)execute_events_requests,
tab,
NULL);