[gtk+] all: Name more idles and timeouts
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] all: Name more idles and timeouts
- Date: Thu, 27 Mar 2014 00:09:40 +0000 (UTC)
commit f71f7215ab31a85bdcc124b1ac6d6c9ca8a6acf1
Author: Bastien Nocera <hadess hadess net>
Date: Sat Mar 22 12:44:01 2014 +0100
all: Name more idles and timeouts
Following up from 438cd857c49242244dda2923ac447f36464b9e72,
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
demos/gtk-demo/images.c | 1 +
gdk/broadway/gdkwindow-broadway.c | 5 ++++-
gdk/gdkwindow.c | 11 +++++++----
gdk/quartz/gdkscreen-quartz.c | 7 +++++--
gdk/x11/gdkasync.c | 12 ++++++++++--
gtk/a11y/gtkaccessibility.c | 1 +
gtk/a11y/gtkiconviewaccessible.c | 5 ++++-
gtk/deprecated/gtkuimanager.c | 1 +
gtk/gtkcombobox.c | 12 +++++++++---
gtk/gtkdnd.c | 11 +++++++----
gtk/gtkentry.c | 1 +
gtk/gtkfilechooserwidget.c | 1 +
gtk/gtkicontheme.c | 9 ++++++---
gtk/gtkprintoperation.c | 12 ++++++++----
gtk/gtkprintunixdialog.c | 1 +
gtk/gtkrecentchooserdefault.c | 1 +
gtk/gtkrecentchoosermenu.c | 1 +
gtk/gtksearchenginesimple.c | 10 ++++++++--
gtk/gtktextview.c | 13 +++++++++----
gtk/gtktoolbar.c | 5 ++++-
gtk/gtktreeview.c | 2 ++
gtk/gtkwidget.c | 5 ++++-
gtk/gtkwindow.c | 6 +++++-
23 files changed, 100 insertions(+), 33 deletions(-)
---
diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c
index ef1386b..baa2d49 100644
--- a/demos/gtk-demo/images.c
+++ b/demos/gtk-demo/images.c
@@ -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
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 97cb6cf..65ca990 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -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
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index acecc87..6e7bcfd 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -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");
}
}
diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c
index e28f3b2..e4d4090 100644
--- a/gdk/quartz/gdkscreen-quartz.c
+++ b/gdk/quartz/gdkscreen-quartz.c
@@ -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");
+ }
}
}
diff --git a/gdk/x11/gdkasync.c b/gdk/x11/gdkasync.c
index 328be08..bcc6ac7 100644
--- a/gdk/x11/gdkasync.c
+++ b/gdk/x11/gdkasync.c
@@ -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);
diff --git a/gtk/a11y/gtkaccessibility.c b/gtk/a11y/gtkaccessibility.c
index 1238b4f..5f2e494 100644
--- a/gtk/a11y/gtkaccessibility.c
+++ b/gtk/a11y/gtkaccessibility.c
@@ -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
diff --git a/gtk/a11y/gtkiconviewaccessible.c b/gtk/a11y/gtkiconviewaccessible.c
index 82c50f9..a646870 100644
--- a/gtk/a11y/gtkiconviewaccessible.c
+++ b/gtk/a11y/gtkiconviewaccessible.c
@@ -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;
}
diff --git a/gtk/deprecated/gtkuimanager.c b/gtk/deprecated/gtkuimanager.c
index 35da0db..b8ecb8a 100644
--- a/gtk/deprecated/gtkuimanager.c
+++ b/gtk/deprecated/gtkuimanager.c
@@ -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");
}
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 6189177..10b6575 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -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");
}
}
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 308e146..46644dd 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -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");
+ }
}
/**
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index f27a98c..dc9756f 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -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");
}
}
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 173f7f8..26732ab 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -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
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 7b22921..a5aa468 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -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
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index 2459080..a7aa2d7 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -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)
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 4761878..c9836a2 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -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
diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c
index 5282f93..61f04ab 100644
--- a/gtk/gtkrecentchooserdefault.c
+++ b/gtk/gtkrecentchooserdefault.c
@@ -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 */
diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c
index 75c6cbf..f70e795 100644
--- a/gtk/gtkrecentchoosermenu.c
+++ b/gtk/gtkrecentchoosermenu.c
@@ -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
diff --git a/gtk/gtksearchenginesimple.c b/gtk/gtksearchenginesimple.c
index 1b6aee4..355ba92 100644
--- a/gtk/gtksearchenginesimple.c
+++ b/gtk/gtksearchenginesimple.c
@@ -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;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 6dffa38..7b9efb7 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -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));
}
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index c4e5581..c572924 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -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);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index bf2c1b1..9bec668 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -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");
}
}
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b82819a..de1a3ef 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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");
+ }
}
/**
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 83964b3..afd4c02 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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");
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]