Commit 438cd857 authored by Bastien Nocera's avatar Bastien Nocera

all: Add names to timeouts

Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
parent dcc0fd22
...@@ -243,6 +243,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle) ...@@ -243,6 +243,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
gdk_frame_clock_flush_idle, gdk_frame_clock_flush_idle,
g_object_ref (clock_idle), g_object_ref (clock_idle),
(GDestroyNotify) g_object_unref); (GDestroyNotify) g_object_unref);
g_source_set_name_by_id (priv->flush_idle_id, "[gtk+] gdk_frame_clock_flush_idle");
} }
if (!priv->in_paint_idle && if (!priv->in_paint_idle &&
...@@ -253,6 +254,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle) ...@@ -253,6 +254,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
gdk_frame_clock_paint_idle, gdk_frame_clock_paint_idle,
g_object_ref (clock_idle), g_object_ref (clock_idle),
(GDestroyNotify) g_object_unref); (GDestroyNotify) g_object_unref);
g_source_set_name_by_id (priv->paint_idle_id, "[gtk+] gdk_frame_clock_paint_idle");
} }
} }
} }
......
...@@ -188,6 +188,7 @@ gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd) ...@@ -188,6 +188,7 @@ gdk_wayland_device_update_window_cursor (GdkWaylandDeviceData *wd)
id = g_timeout_add (next_image_delay, id = g_timeout_add (next_image_delay,
(GSourceFunc)gdk_wayland_device_update_window_cursor, (GSourceFunc)gdk_wayland_device_update_window_cursor,
wd); wd);
g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_window_cursor");
wd->cursor_timeout_id = id; wd->cursor_timeout_id = id;
wd->cursor_image_index = next_image_index; wd->cursor_image_index = next_image_index;
...@@ -1112,10 +1113,12 @@ deliver_key_event (GdkWaylandDeviceData *device, ...@@ -1112,10 +1113,12 @@ deliver_key_event (GdkWaylandDeviceData *device,
device->repeat_timer = device->repeat_timer =
gdk_threads_add_timeout (delay, keyboard_repeat, device); gdk_threads_add_timeout (delay, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
return TRUE; return TRUE;
case 2: case 2:
device->repeat_timer = device->repeat_timer =
gdk_threads_add_timeout (interval, keyboard_repeat, device); gdk_threads_add_timeout (interval, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
return FALSE; return FALSE;
default: default:
return TRUE; return TRUE;
......
...@@ -215,8 +215,10 @@ startup_timeout (void *data) ...@@ -215,8 +215,10 @@ startup_timeout (void *data)
if (std->contexts == NULL) if (std->contexts == NULL)
std->timeout_id = 0; std->timeout_id = 0;
else else {
std->timeout_id = g_timeout_add_seconds ((min_timeout + 500)/1000, startup_timeout, std); std->timeout_id = g_timeout_add_seconds ((min_timeout + 500)/1000, startup_timeout, std);
g_source_set_name_by_id (std->timeout_id, "[gtk+] startup_timeout");
}
/* always remove this one, but we may have reinstalled another one. */ /* always remove this one, but we may have reinstalled another one. */
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
...@@ -249,9 +251,11 @@ add_startup_timeout (GdkScreen *screen, ...@@ -249,9 +251,11 @@ add_startup_timeout (GdkScreen *screen,
data->contexts = g_slist_prepend (data->contexts, sn_data); data->contexts = g_slist_prepend (data->contexts, sn_data);
if (data->timeout_id == 0) if (data->timeout_id == 0) {
data->timeout_id = g_timeout_add_seconds (STARTUP_TIMEOUT_LENGTH_SECONDS, data->timeout_id = g_timeout_add_seconds (STARTUP_TIMEOUT_LENGTH_SECONDS,
startup_timeout, data); startup_timeout, data);
g_source_set_name_by_id (data->timeout_id, "[gtk+] startup_timeout");
}
} }
......
...@@ -2160,6 +2160,7 @@ gtk_real_button_activate (GtkButton *button) ...@@ -2160,6 +2160,7 @@ gtk_real_button_activate (GtkButton *button)
priv->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT, priv->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
button_activate_timeout, button_activate_timeout,
button); button);
g_source_set_name_by_id (priv->activate_timeout, "[gtk+] button_activate_timeout");
priv->button_down = TRUE; priv->button_down = TRUE;
gtk_button_update_state (button); gtk_button_update_state (button);
gtk_widget_queue_draw (GTK_WIDGET (button)); gtk_widget_queue_draw (GTK_WIDGET (button));
......
...@@ -2892,6 +2892,7 @@ calendar_timer (gpointer data) ...@@ -2892,6 +2892,7 @@ calendar_timer (gpointer data)
TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR, TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) calendar_timer, (GSourceFunc) calendar_timer,
(gpointer) calendar, NULL); (gpointer) calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
} }
else else
retval = TRUE; retval = TRUE;
...@@ -2915,6 +2916,7 @@ calendar_start_spinning (GtkCalendar *calendar, ...@@ -2915,6 +2916,7 @@ calendar_start_spinning (GtkCalendar *calendar,
TIMEOUT_INITIAL, TIMEOUT_INITIAL,
(GSourceFunc) calendar_timer, (GSourceFunc) calendar_timer,
(gpointer) calendar, NULL); (gpointer) calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
} }
} }
......
...@@ -1977,6 +1977,7 @@ gtk_cell_renderer_text_popup_unmap (GtkMenu *menu, ...@@ -1977,6 +1977,7 @@ gtk_cell_renderer_text_popup_unmap (GtkMenu *menu,
priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout, priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
data); data);
g_source_set_name_by_id (priv->entry_menu_popdown_timeout, "[gtk+] popdown_timeout");
} }
static void static void
......
...@@ -2148,6 +2148,7 @@ gtk_clipboard_real_store (GtkClipboard *clipboard) ...@@ -2148,6 +2148,7 @@ gtk_clipboard_real_store (GtkClipboard *clipboard)
clipboard->store_loop = g_main_loop_new (NULL, TRUE); clipboard->store_loop = g_main_loop_new (NULL, TRUE);
clipboard->store_timeout = g_timeout_add_seconds (10, (GSourceFunc) gtk_clipboard_store_timeout, clipboard); clipboard->store_timeout = g_timeout_add_seconds (10, (GSourceFunc) gtk_clipboard_store_timeout, clipboard);
g_source_set_name_by_id (clipboard->store_timeout, "[gtk+] gtk_clipboard_store_timeout");
if (g_main_loop_is_running (clipboard->store_loop)) if (g_main_loop_is_running (clipboard->store_loop))
{ {
......
...@@ -3682,10 +3682,12 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget, ...@@ -3682,10 +3682,12 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), TRUE);
priv->auto_scroll = FALSE; priv->auto_scroll = FALSE;
if (priv->scroll_timer == 0) if (priv->scroll_timer == 0) {
priv->scroll_timer = gdk_threads_add_timeout (SCROLL_TIME, priv->scroll_timer = gdk_threads_add_timeout (SCROLL_TIME,
(GSourceFunc) gtk_combo_box_list_scroll_timeout, (GSourceFunc) gtk_combo_box_list_scroll_timeout,
combo_box); combo_box);
g_source_set_name_by_id (priv->scroll_timer, "[gtk+] gtk_combo_box_list_scroll_timeout");
}
priv->popup_in_progress = TRUE; priv->popup_in_progress = TRUE;
......
...@@ -3872,6 +3872,7 @@ gtk_drag_drop (GtkDragSourceInfo *info, ...@@ -3872,6 +3872,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME, info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
gtk_drag_abort_timeout, gtk_drag_abort_timeout,
info); info);
g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
} }
} }
......
...@@ -5212,6 +5212,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer, ...@@ -5212,6 +5212,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer,
g_source_remove (password_hint->source_id); g_source_remove (password_hint->source_id);
password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout, password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout,
(GSourceFunc)gtk_entry_remove_password_hint, entry); (GSourceFunc)gtk_entry_remove_password_hint, entry);
g_source_set_name_by_id (password_hint->source_id, "[gtk+] gtk_entry_remove_password_hint");
} }
} }
} }
...@@ -9497,6 +9498,7 @@ gtk_entry_selection_bubble_popup_set (GtkEntry *entry) ...@@ -9497,6 +9498,7 @@ gtk_entry_selection_bubble_popup_set (GtkEntry *entry)
priv->selection_bubble_timeout_id = priv->selection_bubble_timeout_id =
gdk_threads_add_timeout (1000, gtk_entry_selection_bubble_popup_cb, entry); gdk_threads_add_timeout (1000, gtk_entry_selection_bubble_popup_cb, entry);
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_entry_selection_bubble_popup_cb");
} }
static void static void
...@@ -9906,6 +9908,7 @@ blink_cb (gpointer data) ...@@ -9906,6 +9908,7 @@ blink_cb (gpointer data)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER, priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
blink_cb, blink_cb,
entry); entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
} }
else else
{ {
...@@ -9914,6 +9917,7 @@ blink_cb (gpointer data) ...@@ -9914,6 +9917,7 @@ blink_cb (gpointer data)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER, priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
blink_cb, blink_cb,
entry); entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
} }
/* Remove ourselves */ /* Remove ourselves */
...@@ -9933,6 +9937,7 @@ gtk_entry_check_cursor_blink (GtkEntry *entry) ...@@ -9933,6 +9937,7 @@ gtk_entry_check_cursor_blink (GtkEntry *entry)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER, priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
blink_cb, blink_cb,
entry); entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
} }
} }
else else
...@@ -9960,6 +9965,7 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry) ...@@ -9960,6 +9965,7 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER, priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
blink_cb, blink_cb,
entry); entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
show_cursor (entry); show_cursor (entry);
} }
} }
......
...@@ -2519,6 +2519,7 @@ gtk_entry_completion_changed (GtkWidget *widget, ...@@ -2519,6 +2519,7 @@ gtk_entry_completion_changed (GtkWidget *widget,
gdk_threads_add_timeout (COMPLETION_TIMEOUT, gdk_threads_add_timeout (COMPLETION_TIMEOUT,
gtk_entry_completion_timeout, gtk_entry_completion_timeout,
completion); completion);
g_source_set_name_by_id (completion->priv->completion_timeout, "[gtk+] gtk_entry_completion_timeout");
} }
static gboolean static gboolean
......
...@@ -1147,6 +1147,7 @@ gtk_expander_drag_motion (GtkWidget *widget, ...@@ -1147,6 +1147,7 @@ gtk_expander_drag_motion (GtkWidget *widget,
if (!priv->expanded && !priv->expand_timer) if (!priv->expanded && !priv->expand_timer)
{ {
priv->expand_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander); priv->expand_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
g_source_set_name_by_id (priv->expand_timer, "[gtk+] expand_timeout");
} }
return TRUE; return TRUE;
......
...@@ -3653,6 +3653,7 @@ load_setup_timer (GtkFileChooserDefault *impl) ...@@ -3653,6 +3653,7 @@ load_setup_timer (GtkFileChooserDefault *impl)
g_assert (priv->load_state != LOAD_PRELOAD); g_assert (priv->load_state != LOAD_PRELOAD);
priv->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl); priv->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl);
g_source_set_name_by_id (priv->load_timeout_id, "[gtk+] load_timeout_cb");
priv->load_state = LOAD_PRELOAD; priv->load_state = LOAD_PRELOAD;
} }
......
...@@ -1151,6 +1151,7 @@ gtk_file_system_model_got_files (GObject *object, GAsyncResult *res, gpointer da ...@@ -1151,6 +1151,7 @@ gtk_file_system_model_got_files (GObject *object, GAsyncResult *res, gpointer da
thaw_func, thaw_func,
model, model,
NULL); NULL);
g_source_set_name_by_id (model->dir_thaw_source, "[gtk+] thaw_func");
} }
for (walk = files; walk; walk = walk->next) for (walk = files; walk; walk = walk->next)
......
...@@ -2022,9 +2022,11 @@ gtk_icon_view_motion (GtkWidget *widget, ...@@ -2022,9 +2022,11 @@ gtk_icon_view_motion (GtkWidget *widget,
icon_view->priv->event_last_x = event->x; icon_view->priv->event_last_x = event->x;
icon_view->priv->event_last_y = event->y; icon_view->priv->event_last_y = event->y;
if (icon_view->priv->scroll_timeout_id == 0) if (icon_view->priv->scroll_timeout_id == 0) {
icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout, icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout,
icon_view); icon_view);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] rubberband_scroll_timeout");
}
} }
else else
remove_scroll_timeout (icon_view); remove_scroll_timeout (icon_view);
...@@ -6668,6 +6670,7 @@ gtk_icon_view_drag_motion (GtkWidget *widget, ...@@ -6668,6 +6670,7 @@ gtk_icon_view_drag_motion (GtkWidget *widget,
icon_view->priv->scroll_timeout_id = icon_view->priv->scroll_timeout_id =
gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 50, drag_scroll_timeout, data, (GDestroyNotify) drag_scroll_data_free); gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 50, drag_scroll_timeout, data, (GDestroyNotify) drag_scroll_data_free);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] drag_scroll_timeout");
} }
if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW")) if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
......
...@@ -1480,6 +1480,7 @@ animation_timeout (gpointer data) ...@@ -1480,6 +1480,7 @@ animation_timeout (gpointer data)
priv->animation_timeout = priv->animation_timeout =
gdk_threads_add_timeout (delay, animation_timeout, image); gdk_threads_add_timeout (delay, animation_timeout, image);
g_source_set_name_by_id (priv->animation_timeout, "[gtk+] animation_timeout");
gtk_widget_queue_draw (widget); gtk_widget_queue_draw (widget);
} }
...@@ -1500,9 +1501,11 @@ get_animation_frame (GtkImage *image) ...@@ -1500,9 +1501,11 @@ get_animation_frame (GtkImage *image)
gdk_pixbuf_animation_get_iter (_gtk_icon_helper_peek_animation (priv->icon_helper), NULL); gdk_pixbuf_animation_get_iter (_gtk_icon_helper_peek_animation (priv->icon_helper), NULL);
delay = gdk_pixbuf_animation_iter_get_delay_time (priv->animation_iter); delay = gdk_pixbuf_animation_iter_get_delay_time (priv->animation_iter);
if (delay >= 0) if (delay >= 0) {
priv->animation_timeout = priv->animation_timeout =
gdk_threads_add_timeout (delay, animation_timeout, image); gdk_threads_add_timeout (delay, animation_timeout, image);
g_source_set_name_by_id (priv->animation_timeout, "[gtk+] animation_timeout");
}
} }
/* don't advance the anim iter here, or we could get frame changes between two /* don't advance the anim iter here, or we could get frame changes between two
......
...@@ -3847,6 +3847,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu, ...@@ -3847,6 +3847,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
? MENU_SCROLL_TIMEOUT2 ? MENU_SCROLL_TIMEOUT2
: MENU_SCROLL_TIMEOUT1, : MENU_SCROLL_TIMEOUT1,
gtk_menu_scroll_timeout, menu); gtk_menu_scroll_timeout, menu);
g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
} }
else if (!enter && !in_arrow && priv->upper_arrow_prelight) else if (!enter && !in_arrow && priv->upper_arrow_prelight)
{ {
...@@ -3919,6 +3920,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu, ...@@ -3919,6 +3920,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
? MENU_SCROLL_TIMEOUT2 ? MENU_SCROLL_TIMEOUT2
: MENU_SCROLL_TIMEOUT1, : MENU_SCROLL_TIMEOUT1,
gtk_menu_scroll_timeout, menu); gtk_menu_scroll_timeout, menu);
g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
} }
else if (!enter && !in_arrow && priv->lower_arrow_prelight) else if (!enter && !in_arrow && priv->lower_arrow_prelight)
{ {
...@@ -4401,6 +4403,7 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu, ...@@ -4401,6 +4403,7 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu,
gtk_menu_stop_navigating_submenu_cb, gtk_menu_stop_navigating_submenu_cb,
popdown_data, popdown_data,
(GDestroyNotify) g_free); (GDestroyNotify) g_free);
g_source_set_name_by_id (priv->navigation_timeout, "[gtk+] gtk_menu_stop_navigating_submenu_cb");
} }
} }
......
...@@ -2009,6 +2009,7 @@ _gtk_menu_item_popup_submenu (GtkWidget *widget, ...@@ -2009,6 +2009,7 @@ _gtk_menu_item_popup_submenu (GtkWidget *widget,
priv->timer = gdk_threads_add_timeout (popup_delay, priv->timer = gdk_threads_add_timeout (popup_delay,
gtk_menu_item_popup_timeout, gtk_menu_item_popup_timeout,
menu_item); menu_item);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_menu_item_popup_timeout");
if (event && if (event &&
event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_PRESS &&
......
...@@ -3459,6 +3459,7 @@ gtk_notebook_motion_notify (GtkWidget *widget, ...@@ -3459,6 +3459,7 @@ gtk_notebook_motion_notify (GtkWidget *widget,
priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR, priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
scroll_notebook_timer, scroll_notebook_timer,
(gpointer) notebook); (gpointer) notebook);
g_source_set_name_by_id (priv->dnd_timer, "[gtk+] scroll_notebook_timer");
} }
} }
else else
...@@ -3814,6 +3815,7 @@ gtk_notebook_drag_motion (GtkWidget *widget, ...@@ -3814,6 +3815,7 @@ gtk_notebook_drag_motion (GtkWidget *widget,
priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
gtk_notebook_switch_tab_timeout, gtk_notebook_switch_tab_timeout,
widget); widget);
g_source_set_name_by_id (priv->switch_tab_timer, "[gtk+] gtk_notebook_switch_tab_timeout");
} }
} }
else else
...@@ -4871,6 +4873,7 @@ gtk_notebook_timer (GtkNotebook *notebook) ...@@ -4871,6 +4873,7 @@ gtk_notebook_timer (GtkNotebook *notebook)
priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR, priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) gtk_notebook_timer, (GSourceFunc) gtk_notebook_timer,
(gpointer) notebook); (gpointer) notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
} }
else else
retval = TRUE; retval = TRUE;
...@@ -4889,6 +4892,7 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook) ...@@ -4889,6 +4892,7 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL, priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
(GSourceFunc) gtk_notebook_timer, (GSourceFunc) gtk_notebook_timer,
(gpointer) notebook); (gpointer) notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
priv->need_timer = TRUE; priv->need_timer = TRUE;
} }
} }
......
...@@ -1080,6 +1080,7 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar) ...@@ -1080,6 +1080,7 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR, path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc)gtk_path_bar_scroll_timeout, (GSourceFunc)gtk_path_bar_scroll_timeout,
path_bar); path_bar);
g_source_set_name_by_id (path_bar->priv->timer, "[gtk+] gtk_path_bar_scroll_timeout");
} }
else else
retval = TRUE; retval = TRUE;
...@@ -1184,6 +1185,7 @@ gtk_path_bar_slider_button_press (GtkWidget *widget, ...@@ -1184,6 +1185,7 @@ gtk_path_bar_slider_button_press (GtkWidget *widget,
path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL, path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
(GSourceFunc)gtk_path_bar_scroll_timeout, (GSourceFunc)gtk_path_bar_scroll_timeout,
path_bar); path_bar);
g_source_set_name_by_id (path_bar->priv->timer, "[gtk+] gtk_path_bar_scroll_timeout");
} }
return FALSE; return FALSE;
......
...@@ -413,6 +413,7 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache, ...@@ -413,6 +413,7 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache,
cache->timeout_tag = g_timeout_add_seconds (BLOW_CACHE_TIMEOUT_SEC, cache->timeout_tag = g_timeout_add_seconds (BLOW_CACHE_TIMEOUT_SEC,
blow_cache_cb, cache); blow_cache_cb, cache);
g_source_set_name_by_id (cache->timeout_tag, "[gtk+] blow_cache_cb");
_gtk_pixel_cache_create_surface_if_needed (cache, window, _gtk_pixel_cache_create_surface_if_needed (cache, window,
view_rect, canvas_rect); view_rect, canvas_rect);
......
...@@ -1480,6 +1480,7 @@ check_switch_location_timer (GtkPlacesSidebar *sidebar, const char *uri) ...@@ -1480,6 +1480,7 @@ check_switch_location_timer (GtkPlacesSidebar *sidebar, const char *uri)
if (uri != NULL) { if (uri != NULL) {
sidebar->drop_target_uri = g_strdup (uri); sidebar->drop_target_uri = g_strdup (uri);
sidebar->switch_location_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, switch_location_timer, sidebar); sidebar->switch_location_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, switch_location_timer, sidebar);
g_source_set_name_by_id (sidebar->switch_location_timer, "[gtk+] switch_location_timer");
} }
} }
...@@ -1698,6 +1699,7 @@ drag_leave_callback (GtkTreeView *tree_view, ...@@ -1698,6 +1699,7 @@ drag_leave_callback (GtkTreeView *tree_view,
g_source_remove (sidebar->drag_leave_timeout_id); g_source_remove (sidebar->drag_leave_timeout_id);
sidebar->drag_leave_timeout_id = gdk_threads_add_timeout (500, drag_leave_timeout_cb, sidebar); sidebar->drag_leave_timeout_id = gdk_threads_add_timeout (500, drag_leave_timeout_cb, sidebar);
g_source_set_name_by_id (sidebar->drag_leave_timeout_id, "[gtk+] drag_leave_timeout_cb");
remove_switch_location_timer (sidebar); remove_switch_location_timer (sidebar);
......
...@@ -205,6 +205,7 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah, ...@@ -205,6 +205,7 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
priv->start_y = priv->y; priv->start_y = priv->y;
priv->timeout = priv->timeout =
gdk_threads_add_timeout (priv->hold_time, hold_action, pah); gdk_threads_add_timeout (priv->hold_time, hold_action, pah);
g_source_set_name_by_id (priv->timeout, "[gtk+] hold_action");
} }
else if (event->type == GDK_TOUCH_UPDATE) else if (event->type == GDK_TOUCH_UPDATE)
{ {
...@@ -233,6 +234,7 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah, ...@@ -233,6 +234,7 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
priv->start_y = priv->y; priv->start_y = priv->y;
priv->timeout = priv->timeout =
gdk_threads_add_timeout (priv->hold_time, hold_action, pah); gdk_threads_add_timeout (priv->hold_time, hold_action, pah);
g_source_set_name_by_id (priv->timeout, "[gtk+] hold_action");
} }
else if (event->type == GDK_BUTTON_RELEASE) else if (event->type == GDK_BUTTON_RELEASE)
{ {
......
...@@ -512,10 +512,12 @@ win32_poll_status_timeout (GtkPrintOperation *op) ...@@ -512,10 +512,12 @@ win32_poll_status_timeout (GtkPrintOperation *op)
g_object_ref (op); g_object_ref (op);
win32_poll_status (op); win32_poll_status (op);
if (!gtk_print_operation_is_finished (op)) if (!gtk_print_operation_is_finished (op)) {
op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME, op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout, (GSourceFunc)win32_poll_status_timeout,
op); op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
}
g_object_unref (op); g_object_unref (op);
return FALSE; return FALSE;
} }
...@@ -558,6 +560,7 @@ win32_end_run (GtkPrintOperation *op, ...@@ -558,6 +560,7 @@ win32_end_run (GtkPrintOperation *op,
op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME, op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout, (GSourceFunc)win32_poll_status_timeout,
op); op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
} }
else else
/* Dunno what happened, pretend its finished */ /* Dunno what happened, pretend its finished */
......
...@@ -2985,6 +2985,7 @@ print_pages (GtkPrintOperation *op, ...@@ -2985,6 +2985,7 @@ print_pages (GtkPrintOperation *op,
gdk_threads_add_timeout (SHOW_PROGRESS_TIME, gdk_threads_add_timeout (SHOW_PROGRESS_TIME,
(GSourceFunc)show_progress_timeout, (GSourceFunc)show_progress_timeout,
data); data);
g_source_set_name_by_id (priv->show_progress_timeout_id, "[gtk+] show_progress_timeout");
data->progress = progress; data->progress = progress;
} }
......
...@@ -4257,6 +4257,7 @@ initial_timeout (gpointer data) ...@@ -4257,6 +4257,7 @@ initial_timeout (gpointer data)
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR, priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
second_timeout, second_timeout,
range); range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] second_timeout");
/* remove self */ /* remove self */
return FALSE; return FALSE;
} }
...@@ -4275,6 +4276,7 @@ gtk_range_add_step_timer (GtkRange *range, ...@@ -4275,6 +4276,7 @@ gtk_range_add_step_timer (GtkRange *range,
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL, priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
initial_timeout, initial_timeout,
range); range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] initial_timeout");
priv->timer->step = step; priv->timer->step = step;
gtk_range_scroll (range, priv->timer->step); gtk_range_scroll (range, priv->timer->step);
......
...@@ -1394,7 +1394,10 @@ gtk_recent_manager_changed (GtkRecentManager *manager) ...@@ -1394,7 +1394,10 @@ gtk_recent_manager_changed (GtkRecentManager *manager)
* schedule an emission immediately. * schedule an emission immediately.
*/ */
if (manager->priv->changed_timeout == 0) if (manager->priv->changed_timeout == 0)
manager->priv->changed_timeout = gdk_threads_add_timeout (250, emit_manager_changed, manager); {
manager->priv->changed_timeout = gdk_threads_add_timeout (250, emit_manager_changed, manager);
g_source_set_name_by_id (manager->priv->changed_timeout, "[gtk+] emit_manager_changed");
}
else else
{ {
manager->priv->changed_age += 1; manager->priv->changed_age += 1;
......
...@@ -1237,6 +1237,7 @@ cb_button_press (GtkWidget *widget, ...@@ -1237,6 +1237,7 @@ cb_button_press (GtkWidget *widget,
priv->click_id = gdk_threads_add_timeout (priv->click_timeout, priv->click_id = gdk_threads_add_timeout (priv->click_timeout,
cb_button_timeout, cb_button_timeout,
button); button);
g_source_set_name_by_id (priv->click_id, "[gtk+] cb_button_timeout");
cb_button_timeout (button); cb_button_timeout (button);
return TRUE; return TRUE;
......
...@@ -2742,10 +2742,13 @@ gtk_scrolled_window_captured_button_press (GtkWidget *widget, ...@@ -2742,10 +2742,13 @@ gtk_scrolled_window_captured_button_press (GtkWidget *widget,
/* Only set the timeout if we're going to store an event */ /* Only set the timeout if we're going to store an event */
if (priv->capture_button_press) if (priv->capture_button_press)
priv->release_timeout_id = {
gdk_threads_add_timeout (RELEASE_EVENT_TIMEOUT, priv->release_timeout_id =
(GSourceFunc) gtk_scrolled_window_release_captured_event, gdk_threads_add_timeout (RELEASE_EVENT_TIMEOUT,
scrolled_window); (GSourceFunc) gtk_scrolled_window_release_captured_event,
scrolled_window);
g_source_set_name_by_id (priv->release_timeout_id, "[gtk+] gtk_scrolled_window_release_captured_event");
}
priv->in_drag = FALSE; priv->in_drag = FALSE;
......
...@@ -175,6 +175,7 @@ reset_timeout (GtkSearchEntry *entry) ...@@ -175,6 +175,7 @@ reset_timeout (GtkSearchEntry *entry)
priv->delayed_changed_id = g_timeout_add (DELAYED_TIMEOUT_ID, priv->delayed_changed_id = g_timeout_add (DELAYED_TIMEOUT_ID,
gtk_search_entry_changed_timeout_cb, gtk_search_entry_changed_timeout_cb,
entry); entry);
g_source_set_name_by_id (priv->delayed_changed_id, "[gtk+] gtk_search_entry_changed_timeout_cb");