all: Name more idles and timeouts

Following up from 438cd857c4,
name more timeouts and idles.

The original grep was missing checking for gdk_threads_add_*()
functions (at least for some of the files).

https://bugzilla.gnome.org/show_bug.cgi?id=726870
This commit is contained in:
Bastien Nocera 2014-03-22 12:44:01 +01:00 committed by Matthias Clasen
parent 454c485ebe
commit f71f7215ab
23 changed files with 100 additions and 33 deletions

View File

@ -270,6 +270,7 @@ start_progressive_loading (GtkWidget *image)
load_timeout = gdk_threads_add_timeout (150,
progressive_timeout,
image);
g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
}
static void

View File

@ -132,7 +132,10 @@ static void
queue_flush (GdkWindow *window)
{
if (flush_id == 0)
flush_id = gdk_threads_add_idle (flush_idle, NULL);
{
flush_id = gdk_threads_add_idle (flush_idle, NULL);
g_source_set_name_by_id (flush_id, "[gtk+] flush_idle");
}
}
static void

View File

@ -8229,12 +8229,15 @@ _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
if (!toplevel->synthesize_crossing_event_queued)
{
guint id;
toplevel->synthesize_crossing_event_queued = TRUE;
gdk_threads_add_idle_full (GDK_PRIORITY_EVENTS - 1,
do_synthesize_crossing_event,
g_object_ref (toplevel),
g_object_unref);
id = gdk_threads_add_idle_full (GDK_PRIORITY_EVENTS - 1,
do_synthesize_crossing_event,
g_object_ref (toplevel),
g_object_unref);
g_source_set_name_by_id (id, "[gtk+] do_synthesize_crossing_event");
}
}

View File

@ -282,8 +282,11 @@ display_reconfiguration_callback (CGDirectDisplayID display,
* yet, so we delay our refresh into an idle handler.
*/
if (!screen->screen_changed_id)
screen->screen_changed_id = gdk_threads_add_idle (screen_changed_idle,
screen);
{
screen->screen_changed_id = gdk_threads_add_idle (screen_changed_idle,
screen);
g_source_set_name_by_id (screen->screen_changed_id, "[gtk+] screen_changed_idle");
}
}
}

View File

@ -171,7 +171,11 @@ send_event_handler (Display *dpy,
}
if (state->callback)
gdk_threads_add_idle (callback_idle, state);
{
guint id;
id = gdk_threads_add_idle (callback_idle, state);
g_source_set_name_by_id (id, "[gtk+] callback_idle");
}
DeqAsyncHandler(state->dpy, &state->async);
@ -701,7 +705,11 @@ roundtrip_handler (Display *dpy,
if (state->callback)
gdk_threads_add_idle (roundtrip_callback_idle, state);
{
guint id;
id = gdk_threads_add_idle (roundtrip_callback_idle, state);
g_source_set_name_by_id (id, "[gtk+] roundtrip_callback_idle");
}
DeqAsyncHandler(state->dpy, &state->async);

View File

@ -603,6 +603,7 @@ gail_focus_notify_when_idle (GtkWidget *widget)
}
focus_notify_handler = gdk_threads_add_idle (gail_focus_idle_handler, widget);
g_source_set_name_by_id (focus_notify_handler, "[gtk+] gail_focus_idle_handler");
}
static gboolean

View File

@ -112,7 +112,10 @@ gtk_icon_view_item_accessible_do_action (AtkAction *action,
return FALSE;
if (!item->action_idle_handler)
item->action_idle_handler = gdk_threads_add_idle (idle_do_action, item);
{
item->action_idle_handler = gdk_threads_add_idle (idle_do_action, item);
g_source_set_name_by_id (item->action_idle_handler, "[gtk+] idle_do_action");
}
return TRUE;
}

View File

@ -3155,6 +3155,7 @@ queue_update (GtkUIManager *manager)
manager->private_data->update_tag = gdk_threads_add_idle (
(GSourceFunc)do_updates_idle,
manager);
g_source_set_name_by_id (manager->private_data->update_tag, "[gtk+] do_updates_idle");
}

View File

@ -3428,8 +3428,11 @@ gtk_combo_box_list_popup_resize (GtkComboBox *combo_box)
GtkComboBoxPrivate *priv = combo_box->priv;
if (!priv->resize_idle_id)
priv->resize_idle_id =
gdk_threads_add_idle (list_popup_resize_idle, combo_box);
{
priv->resize_idle_id =
gdk_threads_add_idle (list_popup_resize_idle, combo_box);
g_source_set_name_by_id (priv->resize_idle_id, "[gtk+] list_popup_resize_idle");
}
}
static void
@ -4931,7 +4934,9 @@ static void
popdown_handler (GtkWidget *widget,
gpointer data)
{
gdk_threads_add_idle (popdown_idle, g_object_ref (data));
guint id;
id = gdk_threads_add_idle (popdown_idle, g_object_ref (data));
g_source_set_name_by_id (id, "[gtk+] popdown_idle");
}
static gboolean
@ -5005,6 +5010,7 @@ gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
combo_box->priv->popup_idle_id =
gdk_threads_add_idle (popup_idle, combo_box);
g_source_set_name_by_id (combo_box->priv->popup_idle_id, "[gtk+] popup_idle");
}
}

View File

@ -4186,10 +4186,13 @@ 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 = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW + 5,
gtk_drag_update_idle,
info,
NULL);
{
info->update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW + 5,
gtk_drag_update_idle,
info,
NULL);
g_source_set_name_by_id (info->update_idle, "[gtk+] gtk_drag_update_idle");
}
}
/**

View File

@ -6118,6 +6118,7 @@ gtk_entry_recompute (GtkEntry *entry)
{
priv->recompute_idle = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 15, /* between resize and redraw */
recompute_idle_func, entry, NULL);
g_source_set_name_by_id (priv->recompute_idle, "[gtk+] recompute_idle_func");
}
}

View File

@ -6685,6 +6685,7 @@ recent_start_loading (GtkFileChooserWidget *impl)
recent_idle_load,
load_data,
recent_idle_cleanup);
g_source_set_name_by_id (priv->load_recent_id, "[gtk+] recent_idle_load");
}
static void

View File

@ -801,9 +801,12 @@ queue_theme_changed (GtkIconTheme *icon_theme)
GtkIconThemePrivate *priv = icon_theme->priv;
if (!priv->theme_changed_idle)
priv->theme_changed_idle =
gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2,
theme_changed_idle, icon_theme, NULL);
{
priv->theme_changed_idle =
gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2,
theme_changed_idle, icon_theme, NULL);
g_source_set_name_by_id (priv->theme_changed_idle, "[gtk+] theme_changed_idle");
}
}
static void

View File

@ -631,14 +631,17 @@ preview_ready (GtkPrintOperationPreview *preview,
GtkPrintContext *context,
PreviewOp *pop)
{
guint id;
pop->print_context = context;
g_object_ref (preview);
gdk_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE + 10,
preview_print_idle,
pop,
preview_print_idle_done);
id = gdk_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE + 10,
preview_print_idle,
pop,
preview_print_idle_done);
g_source_set_name_by_id (id, "[gtk+] preview_print_idle");
}
@ -3053,6 +3056,7 @@ print_pages (GtkPrintOperation *op,
print_pages_idle,
data,
print_pages_idle_done);
g_source_set_name_by_id (priv->print_pages_idle_id, "[gtk+] print_pages_idle");
/* Recursive main loop to make sure we don't exit on sync operations */
if (priv->is_sync)

View File

@ -1927,6 +1927,7 @@ schedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
priv->mark_conflicts_id = gdk_threads_add_idle (mark_conflicts_callback,
dialog);
g_source_set_name_by_id (priv->mark_conflicts_id, "[gtk+] mark_conflicts_callback");
}
static void

View File

@ -833,6 +833,7 @@ reload_recent_items (GtkRecentChooserDefault *impl)
load_recent_items,
impl,
cleanup_after_load);
g_source_set_name_by_id (impl->priv->load_id, "[gtk+] load_recent_items");
}
/* taken form gtkfilechooserdialog.c */

View File

@ -1103,6 +1103,7 @@ gtk_recent_chooser_menu_populate (GtkRecentChooserMenu *menu)
idle_populate_func,
pdata,
idle_populate_clean_up);
g_source_set_name_by_id (priv->populate_id, "[gtk+] idle_populate_func");
}
/* bounce activate signal from the recent menu item widget

View File

@ -182,11 +182,14 @@ send_batch (SearchThreadData *data)
if (data->uri_hits)
{
guint id;
hits = g_new (SearchHits, 1);
hits->uris = data->uri_hits;
hits->thread_data = data;
gdk_threads_add_idle (search_thread_add_hits_idle, hits);
id = gdk_threads_add_idle (search_thread_add_hits_idle, hits);
g_source_set_name_by_id (id, "[gtk+] search_thread_add_hits_idle");
}
data->uri_hits = NULL;
@ -269,6 +272,8 @@ search_visit_func (const char *fpath,
static gpointer
search_thread_func (gpointer user_data)
{
guint id;
#ifdef HAVE_FTW_H
SearchThreadData *data;
@ -284,7 +289,8 @@ search_thread_func (gpointer user_data)
send_batch (data);
gdk_threads_add_idle (search_thread_done_idle, data);
id = gdk_threads_add_idle (search_thread_done_idle, data);
g_source_set_name_by_id (id, "[gtk+] search_thread_done_idle");
#endif /* HAVE_FTW_H */
return NULL;

View File

@ -2386,10 +2386,13 @@ queue_update_im_spot_location (GtkTextView *text_view)
/* Use priority a little higher than GTK_TEXT_VIEW_PRIORITY_VALIDATE,
* so we don't wait until the entire buffer has been validated. */
if (!priv->im_spot_idle)
priv->im_spot_idle = gdk_threads_add_idle_full (GTK_TEXT_VIEW_PRIORITY_VALIDATE - 1,
do_update_im_spot_location,
text_view,
NULL);
{
priv->im_spot_idle = gdk_threads_add_idle_full (GTK_TEXT_VIEW_PRIORITY_VALIDATE - 1,
do_update_im_spot_location,
text_view,
NULL);
g_source_set_name_by_id (priv->im_spot_idle, "[gtk+] do_update_im_spot_location");
}
}
static void
@ -4047,6 +4050,7 @@ gtk_text_view_invalidate (GtkTextView *text_view)
if (!priv->first_validate_idle)
{
priv->first_validate_idle = gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2, first_validate_callback, text_view, NULL);
g_source_set_name_by_id (priv->first_validate_idle, "[gtk+] first_validate_callback");
DV (g_print (G_STRLOC": adding first validate idle %d\n",
priv->first_validate_idle));
}
@ -4054,6 +4058,7 @@ gtk_text_view_invalidate (GtkTextView *text_view)
if (!priv->incremental_validate_idle)
{
priv->incremental_validate_idle = gdk_threads_add_idle_full (GTK_TEXT_VIEW_PRIORITY_VALIDATE, incremental_validate_callback, text_view, NULL);
g_source_set_name_by_id (priv->incremental_validate_idle, "[gtk+] incremental_validate_callback");
DV (g_print (G_STRLOC": adding incremental validate idle %d\n",
priv->incremental_validate_idle));
}

View File

@ -1282,7 +1282,10 @@ gtk_toolbar_begin_sliding (GtkToolbar *toolbar)
priv->is_sliding = TRUE;
if (!priv->idle_id)
priv->idle_id = gdk_threads_add_idle (slide_idle_handler, toolbar);
{
priv->idle_id = gdk_threads_add_idle (slide_idle_handler, toolbar);
g_source_set_name_by_id (priv->idle_id, "[gtk+] slide_idle_handler");
}
gtk_widget_get_allocation (widget, &allocation);

View File

@ -6922,6 +6922,7 @@ install_presize_handler (GtkTreeView *tree_view)
{
tree_view->priv->validate_rows_timer =
gdk_threads_add_idle_full (GTK_TREE_VIEW_PRIORITY_VALIDATE, (GSourceFunc) validate_rows, tree_view, NULL);
g_source_set_name_by_id (tree_view->priv->validate_rows_timer, "[gtk+] validate_rows");
}
}
@ -6950,6 +6951,7 @@ install_scroll_sync_handler (GtkTreeView *tree_view)
{
tree_view->priv->scroll_sync_timer =
gdk_threads_add_idle_full (GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC, (GSourceFunc) scroll_sync_handler, tree_view, NULL);
g_source_set_name_by_id (tree_view->priv->scroll_sync_timer, "[gtk+] scroll_sync_handler");
}
}

View File

@ -14708,7 +14708,10 @@ gtk_widget_queue_tooltip_query (GtkWidget *widget)
tooltip_query_displays = g_slist_prepend (tooltip_query_displays, g_object_ref (display));
if (tooltip_query_id == 0)
tooltip_query_id = gdk_threads_add_idle (tooltip_query_idle, NULL);
{
tooltip_query_id = gdk_threads_add_idle (tooltip_query_idle, NULL);
g_source_set_name_by_id (tooltip_query_id, "[gtk+] tooltip_query_idle");
}
}
/**

View File

@ -1330,6 +1330,7 @@ gtk_window_close (GtkWindow *window)
return;
window->priv->delete_event_handler = gdk_threads_add_idle (send_delete_event, window);
g_source_set_name_by_id (window->priv->delete_event_handler, "[gtk+] send_delete_event");
}
static void
@ -2275,7 +2276,10 @@ _gtk_window_notify_keys_changed (GtkWindow *window)
GtkWindowPrivate *priv = window->priv;
if (!priv->keys_changed_handler)
priv->keys_changed_handler = gdk_threads_add_idle (handle_keys_changed, window);
{
priv->keys_changed_handler = gdk_threads_add_idle (handle_keys_changed, window);
g_source_set_name_by_id (priv->keys_changed_handler, "[gtk+] handle_keys_changed");
}
}
/**