factor out add_scroll_timeout(). (taken from maemo-gtk).

2007-01-19  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_motion_bin_window),
	(add_scroll_timeout), (gtk_tree_view_drag_motion): factor out
	add_scroll_timeout().  (taken from maemo-gtk).


svn path=/trunk/; revision=17192
This commit is contained in:
Kristian Rietveld 2007-01-19 10:32:42 +00:00 committed by Kristian Rietveld
parent 170fef7ee2
commit 19a056cc4e
2 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2007-01-19 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_motion_bin_window),
(add_scroll_timeout), (gtk_tree_view_drag_motion): factor out
add_scroll_timeout(). (taken from maemo-gtk).
2007-01-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcalendar.c: Fix problems with the initial

View File

@ -462,8 +462,9 @@ static void gtk_tree_view_tree_window_to_tree_coords (GtkTreeView *tree_view,
gint *tx,
gint *ty);
static gboolean scroll_row_timeout (gpointer data);
static void remove_scroll_timeout (GtkTreeView *tree_view);
static gboolean scroll_row_timeout (gpointer data);
static void add_scroll_timeout (GtkTreeView *tree_view);
static void remove_scroll_timeout (GtkTreeView *tree_view);
static guint tree_view_signals [LAST_SIGNAL] = { 0 };
@ -3917,10 +3918,7 @@ gtk_tree_view_motion_bin_window (GtkWidget *widget,
{
gtk_tree_view_update_rubber_band (tree_view);
if (tree_view->priv->scroll_timeout == 0)
{
tree_view->priv->scroll_timeout = gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
}
add_scroll_timeout (tree_view);
}
/* only check for an initiated drag when a button is pressed */
@ -6619,6 +6617,16 @@ drag_scan_timeout (gpointer data)
}
#endif /* 0 */
static void
add_scroll_timeout (GtkTreeView *tree_view)
{
if (tree_view->priv->scroll_timeout == 0)
{
tree_view->priv->scroll_timeout =
gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
}
}
static void
remove_scroll_timeout (GtkTreeView *tree_view)
{
@ -7157,10 +7165,9 @@ gtk_tree_view_drag_motion (GtkWidget *widget,
tree_view->priv->open_dest_timeout =
gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
}
else if (tree_view->priv->scroll_timeout == 0)
else
{
tree_view->priv->scroll_timeout =
gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
add_scroll_timeout (tree_view);
}
if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))