Replace a lot of idle and timeout calls by the new gdk_threads api.
2006-12-22 Matthias Clasen <mclasen@redhat.com> * *.c: Replace a lot of idle and timeout calls by the new gdk_threads api.
This commit is contained in:
committed by
Matthias Clasen
parent
7854bd1b6e
commit
721c3bc101
@ -152,8 +152,8 @@ struct _GtkRetrievalInfo
|
||||
|
||||
/* Local Functions */
|
||||
static void gtk_selection_init (void);
|
||||
static gint gtk_selection_incr_timeout (GtkIncrInfo *info);
|
||||
static gint gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
|
||||
static gboolean gtk_selection_incr_timeout (GtkIncrInfo *info);
|
||||
static gboolean gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
|
||||
static void gtk_selection_retrieval_report (GtkRetrievalInfo *info,
|
||||
GdkAtom type,
|
||||
gint format,
|
||||
@ -1090,7 +1090,8 @@ gtk_selection_convert (GtkWidget *widget,
|
||||
|
||||
current_retrievals = g_list_append (current_retrievals, info);
|
||||
gdk_selection_convert (widget->window, selection, target, time_);
|
||||
g_timeout_add (1000, (GSourceFunc) gtk_selection_retrieval_timeout, info);
|
||||
gdk_threads_add_timeout (1000,
|
||||
(GSourceFunc) gtk_selection_retrieval_timeout, info);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -2260,7 +2261,7 @@ _gtk_selection_request (GtkWidget *widget,
|
||||
gdk_window_get_events (info->requestor) |
|
||||
GDK_PROPERTY_CHANGE_MASK);
|
||||
current_incrs = g_list_append (current_incrs, info);
|
||||
g_timeout_add (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
|
||||
gdk_threads_add_timeout (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
|
||||
}
|
||||
|
||||
/* If it was a MULTIPLE request, set the property to indicate which
|
||||
@ -2449,8 +2450,6 @@ gtk_selection_incr_timeout (GtkIncrInfo *info)
|
||||
GList *tmp_list;
|
||||
gboolean retval;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
/* Determine if retrieval has finished by checking if it still in
|
||||
list of pending retrievals */
|
||||
|
||||
@ -2486,8 +2485,6 @@ gtk_selection_incr_timeout (GtkIncrInfo *info)
|
||||
retval = TRUE; /* timeout will happen again */
|
||||
}
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -2693,14 +2690,12 @@ _gtk_selection_property_notify (GtkWidget *widget,
|
||||
* results:
|
||||
*************************************************************/
|
||||
|
||||
static gint
|
||||
static gboolean
|
||||
gtk_selection_retrieval_timeout (GtkRetrievalInfo *info)
|
||||
{
|
||||
GList *tmp_list;
|
||||
gboolean retval;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
/* Determine if retrieval has finished by checking if it still in
|
||||
list of pending retrievals */
|
||||
|
||||
@ -2734,8 +2729,6 @@ gtk_selection_retrieval_timeout (GtkRetrievalInfo *info)
|
||||
retval = TRUE; /* timeout will happen again */
|
||||
}
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user