forked from AuroraMiddleware/gtk
just return when we have an input_only window (fix by Owen Taylor)
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org> * gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just return when we have an input_only window (fix by Owen Taylor) * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add scroll_sync_timer * gtk/gtktreeview.c (install_scroll_sync_handler): new function, (scroll_sync_handler): ditto, (gtk_tree_view_unrealize): take scroll_sync_timer into account (gtk_tree_view_row_deleted): install scroll_sync_timer instead of calling top_row_to_dy/dy_to_top_row directly -- this greatly speeds up clearing the model (#73199) * gtk/gtktreemodelsort.c (gtk_tree_model_sort_convert_path_to_child_path): fix up this function, for some reason I really screwed it up (fixes #74663)
This commit is contained in:
parent
071df50f9e
commit
bd7678c78d
19
ChangeLog
19
ChangeLog
@ -1,3 +1,22 @@
|
||||
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
|
||||
return when we have an input_only window (fix by Owen Taylor)
|
||||
|
||||
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
|
||||
scroll_sync_timer
|
||||
|
||||
* gtk/gtktreeview.c (install_scroll_sync_handler): new function,
|
||||
(scroll_sync_handler): ditto,
|
||||
(gtk_tree_view_unrealize): take scroll_sync_timer into account
|
||||
(gtk_tree_view_row_deleted): install scroll_sync_timer instead of
|
||||
calling top_row_to_dy/dy_to_top_row directly
|
||||
-- this greatly speeds up clearing the model (#73199)
|
||||
|
||||
* gtk/gtktreemodelsort.c
|
||||
(gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
|
||||
for some reason I really screwed it up (fixes #74663)
|
||||
|
||||
2002-03-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in (GDK_PIXBUF_DEP_CFLAGS) (GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
@ -1,3 +1,22 @@
|
||||
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
|
||||
return when we have an input_only window (fix by Owen Taylor)
|
||||
|
||||
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
|
||||
scroll_sync_timer
|
||||
|
||||
* gtk/gtktreeview.c (install_scroll_sync_handler): new function,
|
||||
(scroll_sync_handler): ditto,
|
||||
(gtk_tree_view_unrealize): take scroll_sync_timer into account
|
||||
(gtk_tree_view_row_deleted): install scroll_sync_timer instead of
|
||||
calling top_row_to_dy/dy_to_top_row directly
|
||||
-- this greatly speeds up clearing the model (#73199)
|
||||
|
||||
* gtk/gtktreemodelsort.c
|
||||
(gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
|
||||
for some reason I really screwed it up (fixes #74663)
|
||||
|
||||
2002-03-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in (GDK_PIXBUF_DEP_CFLAGS) (GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
@ -1,3 +1,22 @@
|
||||
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
|
||||
return when we have an input_only window (fix by Owen Taylor)
|
||||
|
||||
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
|
||||
scroll_sync_timer
|
||||
|
||||
* gtk/gtktreeview.c (install_scroll_sync_handler): new function,
|
||||
(scroll_sync_handler): ditto,
|
||||
(gtk_tree_view_unrealize): take scroll_sync_timer into account
|
||||
(gtk_tree_view_row_deleted): install scroll_sync_timer instead of
|
||||
calling top_row_to_dy/dy_to_top_row directly
|
||||
-- this greatly speeds up clearing the model (#73199)
|
||||
|
||||
* gtk/gtktreemodelsort.c
|
||||
(gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
|
||||
for some reason I really screwed it up (fixes #74663)
|
||||
|
||||
2002-03-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in (GDK_PIXBUF_DEP_CFLAGS) (GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
@ -1,3 +1,22 @@
|
||||
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
|
||||
return when we have an input_only window (fix by Owen Taylor)
|
||||
|
||||
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
|
||||
scroll_sync_timer
|
||||
|
||||
* gtk/gtktreeview.c (install_scroll_sync_handler): new function,
|
||||
(scroll_sync_handler): ditto,
|
||||
(gtk_tree_view_unrealize): take scroll_sync_timer into account
|
||||
(gtk_tree_view_row_deleted): install scroll_sync_timer instead of
|
||||
calling top_row_to_dy/dy_to_top_row directly
|
||||
-- this greatly speeds up clearing the model (#73199)
|
||||
|
||||
* gtk/gtktreemodelsort.c
|
||||
(gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
|
||||
for some reason I really screwed it up (fixes #74663)
|
||||
|
||||
2002-03-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in (GDK_PIXBUF_DEP_CFLAGS) (GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
@ -1,3 +1,22 @@
|
||||
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
|
||||
return when we have an input_only window (fix by Owen Taylor)
|
||||
|
||||
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
|
||||
scroll_sync_timer
|
||||
|
||||
* gtk/gtktreeview.c (install_scroll_sync_handler): new function,
|
||||
(scroll_sync_handler): ditto,
|
||||
(gtk_tree_view_unrealize): take scroll_sync_timer into account
|
||||
(gtk_tree_view_row_deleted): install scroll_sync_timer instead of
|
||||
calling top_row_to_dy/dy_to_top_row directly
|
||||
-- this greatly speeds up clearing the model (#73199)
|
||||
|
||||
* gtk/gtktreemodelsort.c
|
||||
(gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
|
||||
for some reason I really screwed it up (fixes #74663)
|
||||
|
||||
2002-03-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in (GDK_PIXBUF_DEP_CFLAGS) (GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
@ -1,3 +1,22 @@
|
||||
Sat Mar 16 23:54:56 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_set_static_bit_gravity): just
|
||||
return when we have an input_only window (fix by Owen Taylor)
|
||||
|
||||
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add
|
||||
scroll_sync_timer
|
||||
|
||||
* gtk/gtktreeview.c (install_scroll_sync_handler): new function,
|
||||
(scroll_sync_handler): ditto,
|
||||
(gtk_tree_view_unrealize): take scroll_sync_timer into account
|
||||
(gtk_tree_view_row_deleted): install scroll_sync_timer instead of
|
||||
calling top_row_to_dy/dy_to_top_row directly
|
||||
-- this greatly speeds up clearing the model (#73199)
|
||||
|
||||
* gtk/gtktreemodelsort.c
|
||||
(gtk_tree_model_sort_convert_path_to_child_path): fix up this function,
|
||||
for some reason I really screwed it up (fixes #74663)
|
||||
|
||||
2002-03-16 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* configure.in (GDK_PIXBUF_DEP_CFLAGS) (GDK_PIXBUF_XLIB_DEP_CFLAGS)
|
||||
|
@ -3906,9 +3906,14 @@ static void
|
||||
gdk_window_set_static_bit_gravity (GdkWindow *window, gboolean on)
|
||||
{
|
||||
XSetWindowAttributes xattributes;
|
||||
GdkWindowObject *private;
|
||||
guint xattributes_mask = 0;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
private = GDK_WINDOW_OBJECT (window);
|
||||
if (private->input_only)
|
||||
return;
|
||||
|
||||
xattributes.bit_gravity = StaticGravity;
|
||||
xattributes_mask |= CWBitGravity;
|
||||
|
@ -1964,14 +1964,16 @@ gtk_tree_model_sort_convert_path_to_child_path (GtkTreeModelSort *tree_model_sor
|
||||
for (i = 0; i < gtk_tree_path_get_depth (sorted_path); i++)
|
||||
{
|
||||
if ((level == NULL) ||
|
||||
(level->array->len > sorted_indices[i]))
|
||||
(level->array->len <= sorted_indices[i]))
|
||||
{
|
||||
gtk_tree_path_free (retval);
|
||||
return NULL;
|
||||
}
|
||||
if (g_array_index (level->array, SortElt, sorted_indices[i]).children == NULL)
|
||||
gtk_tree_model_sort_build_level (tree_model_sort, level, &g_array_index (level->array, SortElt, sorted_indices[i]));
|
||||
|
||||
if (level == NULL)
|
||||
break;
|
||||
|
||||
gtk_tree_path_append_index (retval, g_array_index (level->array, SortElt, i).offset);
|
||||
}
|
||||
|
@ -116,6 +116,7 @@ struct _GtkTreeViewPrivate
|
||||
GtkTreeViewColumn *edited_column;
|
||||
guint presize_handler_timer;
|
||||
guint validate_rows_timer;
|
||||
guint scroll_sync_timer;
|
||||
|
||||
/* Focus code */
|
||||
GtkTreeViewColumn *focus_column;
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#define GTK_TREE_VIEW_SEARCH_DIALOG_KEY "gtk-tree-view-search-dialog"
|
||||
#define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5)
|
||||
#define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2)
|
||||
#define GTK_TREE_VIEW_NUM_ROWS_PER_IDLE 500
|
||||
#define SCROLL_EDGE_SIZE 15
|
||||
#define EXPANDER_EXTRA_PADDING 4
|
||||
@ -263,6 +264,7 @@ static void validate_visible_area (GtkTreeView *tree_view);
|
||||
static gboolean validate_rows_handler (GtkTreeView *tree_view);
|
||||
static gboolean presize_handler_callback (gpointer data);
|
||||
static void install_presize_handler (GtkTreeView *tree_view);
|
||||
static void install_scroll_sync_handler (GtkTreeView *tree_view);
|
||||
static void gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view);
|
||||
static void gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view);
|
||||
|
||||
@ -1357,6 +1359,12 @@ gtk_tree_view_unrealize (GtkWidget *widget)
|
||||
tree_view->priv->validate_rows_timer = 0;
|
||||
}
|
||||
|
||||
if (tree_view->priv->scroll_sync_timer != 0)
|
||||
{
|
||||
gtk_timeout_remove (tree_view->priv->scroll_sync_timer);
|
||||
tree_view->priv->scroll_sync_timer = 0;
|
||||
}
|
||||
|
||||
for (list = tree_view->priv->columns; list; list = list->next)
|
||||
_gtk_tree_view_column_unrealize_button (GTK_TREE_VIEW_COLUMN (list->data));
|
||||
|
||||
@ -4048,6 +4056,34 @@ install_presize_handler (GtkTreeView *tree_view)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
scroll_sync_handler (GtkTreeView *tree_view)
|
||||
{
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
|
||||
gtk_tree_view_top_row_to_dy (tree_view);
|
||||
else
|
||||
gtk_tree_view_dy_to_top_row (tree_view);
|
||||
|
||||
tree_view->priv->scroll_sync_timer = 0;
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
install_scroll_sync_handler (GtkTreeView *tree_view)
|
||||
{
|
||||
if (!tree_view->priv->scroll_sync_timer)
|
||||
{
|
||||
tree_view->priv->scroll_sync_timer =
|
||||
g_idle_add_full (GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC, (GSourceFunc) scroll_sync_handler, tree_view, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Always call this iff dy is in the visible range. If the tree is empty, then
|
||||
* it's set to be NULL, and top_row_dy is 0;
|
||||
*/
|
||||
@ -4103,6 +4139,7 @@ gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view)
|
||||
gtk_tree_row_reference_free (tree_view->priv->top_row);
|
||||
tree_view->priv->top_row = NULL;
|
||||
tree_view->priv->top_row_dy = 0;
|
||||
/* DO NOT install the idle handler */
|
||||
gtk_tree_view_dy_to_top_row (tree_view);
|
||||
return;
|
||||
}
|
||||
@ -4110,7 +4147,7 @@ gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view)
|
||||
if (MAX (BACKGROUND_HEIGHT (node), tree_view->priv->expander_size)
|
||||
< tree_view->priv->top_row_dy)
|
||||
{
|
||||
/* new top row */
|
||||
/* new top row -- do NOT install the idle handler */
|
||||
gtk_tree_view_dy_to_top_row (tree_view);
|
||||
return;
|
||||
}
|
||||
@ -5835,10 +5872,7 @@ gtk_tree_view_row_deleted (GtkTreeModel *model,
|
||||
_gtk_rbtree_remove_node (tree, node);
|
||||
}
|
||||
|
||||
if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
|
||||
gtk_tree_view_top_row_to_dy (tree_view);
|
||||
else
|
||||
gtk_tree_view_dy_to_top_row (tree_view);
|
||||
install_scroll_sync_handler (tree_view);
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user