Commit 721c3bc1 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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.
parent 7854bd1b
2006-12-22 Matthias Clasen <mclasen@redhat.com>
* *.c: Replace a lot of idle and timeout calls by
the new gdk_threads api.
* gdk/gdk.symbols:
* gdk/gdk.h:
* gdk/gdk.c: Add functions to allow threadsafe handling
......
......@@ -255,7 +255,7 @@ start_progressive_loading (GtkWidget *image)
* The timeout simply simulates a slow data source by inserting
* pauses in the reading process.
*/
load_timeout = g_timeout_add (150,
load_timeout = gdk_threads_add_timeout (150,
progressive_timeout,
image);
}
......
......@@ -187,7 +187,9 @@ timeout (gpointer data)
: MAX (127, fabs (255 * cos (f * 2.0 * G_PI)))));
}
GDK_THREADS_ENTER ();
gtk_widget_queue_draw (da);
GDK_THREADS_LEAVE ();
frame_num++;
return TRUE;
......
......@@ -225,7 +225,7 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), da);
timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
timeout_id = gdk_threads_add_timeout (FRAME_DELAY, timeout, NULL);
gtk_widget_show_all (window);
gtk_main ();
......
......@@ -301,7 +301,7 @@ start_progressive_loading (GtkWidget *image)
* The timeout simply simulates a slow data source by inserting
* pauses in the reading process.
*/
lc->load_timeout = g_timeout_add (100,
lc->load_timeout = gdk_threads_add_timeout (100,
progressive_timeout,
image);
}
......
......@@ -628,7 +628,7 @@ main (int argc, char **argv)
status.readlen = readlen;
status.timeout = g_timeout_add (100, update_timeout, &status);
status.timeout = gdk_threads_add_timeout (100, update_timeout, &status);
}
#endif
}
......
......@@ -90,7 +90,7 @@ static void
realize_callback (GtkWidget *widget,
WidgetInfo *info)
{
g_timeout_add (500, (GSourceFunc)adjust_size_callback, info);
gdk_threads_add_timeout (500, (GSourceFunc)adjust_size_callback, info);
}
static WidgetInfo *
......
......@@ -585,8 +585,8 @@ gtk_dial_update_mouse( GtkDial *dial, gint x, gint y )
if (dial->timer)
g_source_remove (dial->timer);
dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
(GtkFunction) gtk_dial_timer,
dial->timer = gdk_threads_add_timeout (SCROLL_DELAY_LENGTH,
(GSourceFunc) gtk_dial_timer,
(gpointer) dial);
}
}
......
......@@ -134,7 +134,7 @@ int main( int argc,
gtk_widget_show (pdata->pbar);
/* Add a timer callback to update the value of the progress bar */
pdata->timer = g_timeout_add (100, progress_timeout, pdata);
pdata->timer = gdk_threads_add_timeout (100, progress_timeout, pdata);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
......
......@@ -100,9 +100,7 @@ gdk_window_directfb_process_all_updates (void)
static gboolean
gdk_window_update_idle (gpointer data)
{
GDK_THREADS_ENTER ();
gdk_window_directfb_process_all_updates ();
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -115,7 +113,7 @@ gdk_window_schedule_update (GdkWindow *window)
if (!update_idle)
{
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
update_idle = gdk_threads_add_idle (GDK_PRIORITY_REDRAW,
gdk_window_update_idle, NULL, NULL);
}
}
......
......@@ -209,6 +209,23 @@ guint gdk_threads_add_timeout (guint interval,
gpointer data);
guint gdk_threads_add_idle_full (gint priority,
GSourceFunc function,
gpointer data,
GDestroyNotify notify);
guint gdk_threads_add_idle (GSourceFunc function,
gpointer data);
guint gdk_threads_add_timeout_full (gint priority,
guint interval,
GSourceFunc function,
gpointer data,
GDestroyNotify notify);
guint gdk_threads_add_timeout (guint interval,
GSourceFunc function,
gpointer data);
#ifdef G_THREADS_ENABLED
# define GDK_THREADS_ENTER() G_STMT_START { \
if (gdk_threads_lock) \
......
......@@ -2240,9 +2240,7 @@ static gboolean debug_updates = FALSE;
static gboolean
gdk_window_update_idle (gpointer data)
{
GDK_THREADS_ENTER ();
gdk_window_process_all_updates ();
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -2255,7 +2253,7 @@ gdk_window_schedule_update (GdkWindow *window)
if (!update_idle)
{
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
gdk_window_update_idle, NULL, NULL);
}
}
......
......@@ -690,7 +690,7 @@ set_ignore_core (gboolean ignore)
}
else
if (!ignore_core_timer)
ignore_core_timer = g_timeout_add (PROXIMITY_OUT_DELAY,
ignore_core_timer = gdk_threads_add_timeout (PROXIMITY_OUT_DELAY,
ignore_core_timefunc, NULL);
}
#endif /* HAVE_WINTAB */
......
......@@ -1490,12 +1490,8 @@ gtk_real_button_released (GtkButton *button)
static gboolean
button_activate_timeout (gpointer data)
{
GDK_THREADS_ENTER ();
gtk_button_finish_activate (data, TRUE);
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -1520,7 +1516,7 @@ gtk_real_button_activate (GtkButton *button)
gtk_grab_add (widget);
button->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT,
button->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
button_activate_timeout,
button);
button->button_down = TRUE;
......
......@@ -2374,8 +2374,6 @@ calendar_timer (gpointer data)
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
gboolean retval = FALSE;
GDK_THREADS_ENTER ();
if (priv->timer)
{
calendar_arrow_action (calendar, priv->click_child);
......@@ -2389,7 +2387,7 @@ calendar_timer (gpointer data)
g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
priv->need_timer = FALSE;
priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
timeout * SCROLL_DELAY_FACTOR,
(GSourceFunc) calendar_timer,
(gpointer) calendar, NULL);
......@@ -2398,8 +2396,6 @@ calendar_timer (gpointer data)
retval = TRUE;
}
GDK_THREADS_LEAVE ();
return retval;
}
......@@ -2420,7 +2416,7 @@ calendar_start_spinning (GtkCalendar *calendar,
g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
priv->need_timer = TRUE;
priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
timeout,
(GSourceFunc) calendar_timer,
(gpointer) calendar, NULL);
......
......@@ -1741,8 +1741,6 @@ popdown_timeout (gpointer data)
{
GtkCellRendererTextPrivate *priv;
GDK_THREADS_ENTER ();
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data);
priv->entry_menu_popdown_timeout = 0;
......@@ -1750,8 +1748,6 @@ popdown_timeout (gpointer data)
if (!GTK_WIDGET_HAS_FOCUS (priv->entry))
gtk_cell_renderer_text_editing_done (GTK_CELL_EDITABLE (priv->entry), data);
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -1768,7 +1764,7 @@ gtk_cell_renderer_text_popup_unmap (GtkMenu *menu,
if (priv->entry_menu_popdown_timeout)
return;
priv->entry_menu_popdown_timeout = g_timeout_add (500, popdown_timeout,
priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
data);
}
......
......@@ -1862,6 +1862,8 @@ gtk_clipboard_store (GtkClipboard *clipboard)
if (!gdk_display_supports_clipboard_persistence (clipboard->display))
return;
g_object_ref (clipboard);
clipboard_widget = get_clipboard_widget (clipboard->display);
clipboard->notify_signal_id = g_signal_connect (clipboard_widget, "selection_notify_event",
G_CALLBACK (gtk_clipboard_selection_notify), clipboard);
......@@ -1893,6 +1895,8 @@ gtk_clipboard_store (GtkClipboard *clipboard)
clipboard->notify_signal_id = 0;
clipboard->storing_selection = FALSE;
g_object_unref (clipboard);
}
/* Stores all clipboard selections on all displays, called from
......
......@@ -5264,7 +5264,7 @@ gtk_clist_motion (GtkWidget *widget,
if (clist->htimer)
return FALSE;
clist->htimer = g_timeout_add
clist->htimer = gdk_threads_add_timeout
(SCROLL_TIME, (GSourceFunc) horizontal_timeout, clist);
if (!((x < 0 && clist->hadjustment->value == 0) ||
......@@ -5296,7 +5296,7 @@ gtk_clist_motion (GtkWidget *widget,
if (clist->vtimer)
return FALSE;
clist->vtimer = g_timeout_add (SCROLL_TIME,
clist->vtimer = gdk_threads_add_timeout (SCROLL_TIME,
(GSourceFunc) vertical_timeout, clist);
if (clist->drag_button &&
......@@ -7039,26 +7039,18 @@ do_fake_motion (GtkWidget *widget)
static gint
horizontal_timeout (GtkCList *clist)
{
GDK_THREADS_ENTER ();
clist->htimer = 0;
do_fake_motion (GTK_WIDGET (clist));
GDK_THREADS_LEAVE ();
return FALSE;
}
static gint
vertical_timeout (GtkCList *clist)
{
GDK_THREADS_ENTER ();
clist->vtimer = 0;
do_fake_motion (GTK_WIDGET (clist));
GDK_THREADS_LEAVE ();
return FALSE;
}
......
......@@ -69,7 +69,7 @@ static void gtk_combo_unrealize (GtkWidget *widget);
static void gtk_combo_destroy (GtkObject *combo);
static GtkListItem *gtk_combo_find (GtkCombo *combo);
static gchar * gtk_combo_func (GtkListItem *li);
static gint gtk_combo_focus_idle (GtkCombo *combo);
static gboolean gtk_combo_focus_idle (GtkCombo *combo);
static gint gtk_combo_entry_focus_out (GtkEntry *entry,
GdkEventFocus *event,
GtkCombo *combo);
......@@ -411,6 +411,7 @@ gtk_combo_entry_focus_out (GtkEntry * entry, GdkEventFocus * event, GtkCombo * c
g_cclosure_new_object (G_CALLBACK (gtk_combo_focus_idle),
G_OBJECT (combo)));
g_source_attach (focus_idle, NULL);
g_source_unref (focus_idle);
/*g_signal_stop_emission_by_name (entry, "focus_out_event"); */
return TRUE;
......
......@@ -3032,8 +3032,6 @@ list_popup_resize_idle (gpointer user_data)
GtkComboBox *combo_box;
gint x, y, width, height;
GDK_THREADS_ENTER ();
combo_box = GTK_COMBO_BOX (user_data);
if (combo_box->priv->tree_view &&
......@@ -3047,8 +3045,6 @@ list_popup_resize_idle (gpointer user_data)
combo_box->priv->resize_idle_id = 0;
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -3057,7 +3053,7 @@ gtk_combo_box_list_popup_resize (GtkComboBox *combo_box)
{
if (!combo_box->priv->resize_idle_id)
combo_box->priv->resize_idle_id =
g_idle_add (list_popup_resize_idle, combo_box);
gdk_threads_add_idle (list_popup_resize_idle, combo_box);
}
static void
......@@ -3582,7 +3578,7 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget,
combo_box->priv->auto_scroll = FALSE;
if (combo_box->priv->scroll_timer == 0)
combo_box->priv->scroll_timer = g_timeout_add (SCROLL_TIME,
combo_box->priv->scroll_timer = gdk_threads_add_timeout (SCROLL_TIME,
(GSourceFunc) gtk_combo_box_list_scroll_timeout,
combo_box);
......@@ -3776,8 +3772,6 @@ gtk_combo_box_list_scroll_timeout (GtkComboBox *combo_box)
{
gint x, y;
GDK_THREADS_ENTER ();
if (combo_box->priv->auto_scroll)
{
gdk_window_get_pointer (combo_box->priv->tree_view->window,
......@@ -3785,8 +3779,6 @@ gtk_combo_box_list_scroll_timeout (GtkComboBox *combo_box)
gtk_combo_box_list_auto_scroll (combo_box, x, y);
}
GDK_THREADS_LEAVE ();
return TRUE;
}
......@@ -5175,8 +5167,6 @@ popdown_idle (gpointer data)
{
GtkComboBox *combo_box;
GDK_THREADS_ENTER ();
combo_box = GTK_COMBO_BOX (data);
gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
......@@ -5184,8 +5174,6 @@ popdown_idle (gpointer data)
g_object_unref (combo_box);
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -5193,7 +5181,7 @@ static void
popdown_handler (GtkWidget *widget,
gpointer data)
{
g_idle_add (popdown_idle, g_object_ref (data));
gdk_threads_add_idle (popdown_idle, g_object_ref (data));
}
static gboolean
......@@ -5201,8 +5189,6 @@ popup_idle (gpointer data)
{
GtkComboBox *combo_box;
GDK_THREADS_ENTER ();
combo_box = GTK_COMBO_BOX (data);
if (GTK_IS_MENU (combo_box->priv->popup_widget) &&
......@@ -5217,8 +5203,6 @@ popup_idle (gpointer data)
combo_box->priv->popup_idle_id = 0;
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -5253,7 +5237,7 @@ gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
*/
if (combo_box->priv->is_cell_renderer &&
combo_box->priv->cell_view && !combo_box->priv->tree_view)
combo_box->priv->popup_idle_id = g_idle_add (popup_idle, combo_box);
combo_box->priv->popup_idle_id = gdk_threads_add_idle (popup_idle, combo_box);
}
......
......@@ -1088,8 +1088,6 @@ gtk_container_get_resize_container (GtkContainer *container)
static gboolean
gtk_container_idle_sizer (gpointer data)
{
GDK_THREADS_ENTER ();
/* we may be invoked with a container_resize_queue of NULL, because
* queue_resize could have been adding an extra idle function while
* the queue still got processed. we better just ignore such case
......@@ -1112,8 +1110,6 @@ gtk_container_idle_sizer (gpointer data)
gdk_window_process_all_updates ();
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -1151,7 +1147,7 @@ _gtk_container_queue_resize (GtkContainer *container)
{
GTK_PRIVATE_SET_FLAG (resize_container, GTK_RESIZE_PENDING);
if (container_resize_queue == NULL)
g_idle_add_full (GTK_PRIORITY_RESIZE,
gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE,
gtk_container_idle_sizer,
NULL, NULL);
container_resize_queue = g_slist_prepend (container_resize_queue, resize_container);
......
......@@ -3453,7 +3453,7 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
* to respond really late, we still are OK.
*/
gtk_drag_clear_source_info (info->context);
g_timeout_add (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
gdk_threads_add_timeout (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
}
}
}
......@@ -3531,7 +3531,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
gtk_widget_hide (info->icon_window);
gdk_drag_drop (info->context, time);
info->drop_timeout = g_timeout_add (DROP_ABORT_TIME,
info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
gtk_drag_abort_timeout,
info);
}
......@@ -3680,8 +3680,6 @@ gtk_drag_anim_timeout (gpointer data)
gint x, y;
gboolean retval;
GDK_THREADS_ENTER ();
if (anim->step == anim->n_steps)
{
gtk_drag_source_info_destroy (anim->info);
......@@ -3711,8 +3709,6 @@ gtk_drag_anim_timeout (gpointer data)
retval = TRUE;
}
GDK_THREADS_LEAVE ();
return retval;
}
......@@ -3812,8 +3808,6 @@ gtk_drag_update_idle (gpointer data)
GdkDragAction possible_actions;
guint32 time;
GDK_THREADS_ENTER ();
info->update_idle = 0;
if (info->last_event)
......@@ -3847,8 +3841,6 @@ gtk_drag_update_idle (gpointer data)
}
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -3859,7 +3851,7 @@ gtk_drag_add_update_idle (GtkDragSourceInfo *info)
* from the last move can catch up before we move again.
*/
if (!info->update_idle)
info->update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW + 5,
info->update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW + 5,
gtk_drag_update_idle,
info,
NULL);
......@@ -4185,16 +4177,12 @@ gtk_drag_abort_timeout (gpointer data)
GtkDragSourceInfo *info = data;
guint32 time = GDK_CURRENT_TIME;
GDK_THREADS_ENTER ();
if (info->proxy_dest)
time = info->proxy_dest->proxy_drop_time;
info->drop_timeout = 0;
gtk_drag_drop_finished (info, FALSE, time);
GDK_THREADS_LEAVE ();
return FALSE;
}
......
......@@ -3072,8 +3072,6 @@ recompute_idle_func (gpointer data)
{
GtkEntry *entry;
GDK_THREADS_ENTER ();
entry = GTK_ENTRY (data);
entry->recompute_idle = 0;
......@@ -3086,8 +3084,6 @@ recompute_idle_func (gpointer data)
update_im_cursor_location (entry);
}
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -3099,7 +3095,7 @@ gtk_entry_recompute (GtkEntry *entry)
if (!entry->recompute_idle)
{
entry->recompute_idle = g_idle_add_full (G_PRIORITY_HIGH_IDLE + 15, /* between resize and redraw */
entry->recompute_idle = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 15, /* between resize and redraw */
recompute_idle_func, entry, NULL);
}
}
......@@ -3126,13 +3122,9 @@ append_char (GString *str,
static gboolean
gtk_entry_remove_password_hint (gpointer data)
{
GDK_THREADS_ENTER();
/* Force the string to be redrawn, but now without a visible character */
gtk_entry_recompute (GTK_ENTRY (data));
GDK_THREADS_LEAVE();
return FALSE;
}
......@@ -3299,7 +3291,7 @@ gtk_entry_create_layout (GtkEntry *entry,
password_hint->password_hint_length = 0;
password_hint->password_hint_timeout_id =
g_timeout_add (password_hint_timeout,
gdk_threads_add_timeout (password_hint_timeout,
(GSourceFunc) gtk_entry_remove_password_hint,
entry);
}
......@@ -5325,8 +5317,6 @@ blink_cb (gpointer data)
GtkEntryPrivate *priv;
gint blink_timeout;
GDK_THREADS_ENTER ();
entry = GTK_ENTRY (data);
priv = GTK_ENTRY_GET_PRIVATE (entry);
......@@ -5351,7 +5341,7 @@ blink_cb (gpointer data)
else if (entry->cursor_visible)
{
hide_cursor (entry);
entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
entry);
}
......@@ -5359,13 +5349,11 @@ blink_cb (gpointer data)
{
show_cursor (entry);
priv->blink_time += get_cursor_time (entry);
entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
entry);
}
GDK_THREADS_LEAVE ();
/* Remove ourselves */
return FALSE;
}
......@@ -5382,7 +5370,7 @@ gtk_entry_check_cursor_blink (GtkEntry *entry)
if (!entry->blink_timeout)
{
show_cursor (entry);
entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
entry);
}
......@@ -5408,7 +5396,7 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry)
if (entry->blink_timeout != 0)
g_source_remove (entry->blink_timeout);
entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
entry);
show_cursor (entry);
......@@ -5432,8 +5420,6 @@ gtk_entry_completion_timeout (gpointer data)
{
GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
GDK_THREADS_ENTER ();
completion->priv->completion_timeout = 0;
if (completion->priv->filter_model &&
......@@ -5470,8 +5456,6 @@ gtk_entry_completion_timeout (gpointer data)
else if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
_gtk_entry_completion_popdown (completion);
GDK_THREADS_LEAVE ();
return FALSE;
}
......@@ -5698,7 +5682,7 @@ gtk_entry_completion_changed (GtkWidget *entry,
}
completion->priv->completion_timeout =
g_timeout_add (COMPLETION_TIMEOUT,
gdk_threads_add_timeout (COMPLETION_TIMEOUT,
gtk_entry_completion_timeout,
completion);
}
......
......@@ -1004,7 +1004,7 @@ gtk_expander_drag_motion (GtkWidget *widget,
settings = gtk_widget_get_settings (widget);
g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
priv->expand_timer = g_timeout_add (timeout, (GSourceFunc) expand_timeout, expander);
priv->expand_timer = gdk_threads_add_timeout (timeout, (GSourceFunc) expand_timeout, expander);
}
return TRUE;
......@@ -1276,8 +1276,6 @@ gtk_expander_animation_timeout (GtkExpander *expander)
GdkRectangle area;
gboolean finish = FALSE;
GDK_THREADS_ENTER();
if (GTK_WIDGET_REALIZED (expander))
{
get_expander_bounds (expander, &area);
......@@ -1317,8 +1315,6 @@ gtk_expander_animation_timeout (GtkExpander *expander)
gtk_widget_queue_resize (GTK_WIDGET (expander));
}
GDK_THREADS_LEAVE();
return !finish;
}
......@@ -1331,7 +1327,7 @@ gtk_expander_start_animation (GtkExpander *expander)
g_source_remove (priv->animation_timeout);
priv->animation_timeout =
g_timeout_add (50,
gdk_threads_add_timeout (50,
(GSourceFunc) gtk_expander_animation_timeout,
expander);
}
......
......@@ -5709,8 +5709,6 @@ load_timeout_cb (gpointer data)
profile_start ("start", NULL);
GDK_THREADS_ENTER ();
impl = GTK_FILE_CHOOSER_DEFAULT (data);
g_assert (impl->load_state == LOAD_PRELOAD);
g_assert (impl->load_timeout_id != 0);
......@@ -5721,8 +5719,6 @@ load_timeout_cb (gpointer data)
load_set_model (impl);
GDK_THREADS_LEAVE ();
profile_end ("end", NULL);
return FALSE;
......@@ -5735,7 +5731,7 @@ load_setup_timer (GtkFileChooserDefault *impl)
g_assert (impl->load_timeout_id == 0);
g_assert (impl->load_state != LOAD_PRELOAD);
impl->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
impl->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl);
impl->load_state = LOAD_PRELOAD;
}
......
......@@ -254,8 +254,7 @@ static GtkFileInfo *create_file_info (GtkFileFolderUnix *folder_uni
struct stat *statbuf,
const char *mime_type);
static gboolean execute_callbacks_idle (gpointer data);
static void execute_callbacks (gpointer data);
static gboolean execute_callbacks (gpointer data);
static gboolean fill_in_names (GtkFileFolderUnix *folder_unix,
GError **error);
......@@ -700,7 +699,7 @@ struct callback_info
static void
static gboolean
execute_callbacks (gpointer data)
{
GSList *l;
......@@ -747,18 +746,6 @@ execute_callbacks (gpointer data)