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)
gdk_frame_clock_flush_idle,
g_object_ref (clock_idle),
(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 &&
......@@ -253,6 +254,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
gdk_frame_clock_paint_idle,
g_object_ref (clock_idle),
(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)
id = g_timeout_add (next_image_delay,
(GSourceFunc)gdk_wayland_device_update_window_cursor,
wd);
g_source_set_name_by_id (id, "[gtk+] gdk_wayland_device_update_window_cursor");
wd->cursor_timeout_id = id;
wd->cursor_image_index = next_image_index;
......@@ -1112,10 +1113,12 @@ deliver_key_event (GdkWaylandDeviceData *device,
device->repeat_timer =
gdk_threads_add_timeout (delay, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
return TRUE;
case 2:
device->repeat_timer =
gdk_threads_add_timeout (interval, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
return FALSE;
default:
return TRUE;
......
......@@ -215,8 +215,10 @@ startup_timeout (void *data)
if (std->contexts == NULL)
std->timeout_id = 0;
else
else {
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. */
return G_SOURCE_REMOVE;
......@@ -249,9 +251,11 @@ add_startup_timeout (GdkScreen *screen,
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,
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)
priv->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
button_activate_timeout,
button);
g_source_set_name_by_id (priv->activate_timeout, "[gtk+] button_activate_timeout");
priv->button_down = TRUE;
gtk_button_update_state (button);
gtk_widget_queue_draw (GTK_WIDGET (button));
......
......@@ -2892,6 +2892,7 @@ calendar_timer (gpointer data)
TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) calendar_timer,
(gpointer) calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
}
else
retval = TRUE;
......@@ -2915,6 +2916,7 @@ calendar_start_spinning (GtkCalendar *calendar,
TIMEOUT_INITIAL,
(GSourceFunc) calendar_timer,
(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,
priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
data);
g_source_set_name_by_id (priv->entry_menu_popdown_timeout, "[gtk+] popdown_timeout");
}
static void
......
......@@ -2148,6 +2148,7 @@ gtk_clipboard_real_store (GtkClipboard *clipboard)
clipboard->store_loop = g_main_loop_new (NULL, TRUE);
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))
{
......
......@@ -3682,10 +3682,12 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), TRUE);
priv->auto_scroll = FALSE;
if (priv->scroll_timer == 0)
if (priv->scroll_timer == 0) {
priv->scroll_timer = gdk_threads_add_timeout (SCROLL_TIME,
(GSourceFunc) gtk_combo_box_list_scroll_timeout,
combo_box);
g_source_set_name_by_id (priv->scroll_timer, "[gtk+] gtk_combo_box_list_scroll_timeout");
}
priv->popup_in_progress = TRUE;
......
......@@ -3872,6 +3872,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
gtk_drag_abort_timeout,
info);
g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
}
}
......
......@@ -5212,6 +5212,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer,
g_source_remove (password_hint->source_id);
password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout,
(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)
priv->selection_bubble_timeout_id =
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
......@@ -9906,6 +9908,7 @@ blink_cb (gpointer data)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
else
{
......@@ -9914,6 +9917,7 @@ blink_cb (gpointer data)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
/* Remove ourselves */
......@@ -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,
blink_cb,
entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
else
......@@ -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,
blink_cb,
entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
show_cursor (entry);
}
}
......
......@@ -2519,6 +2519,7 @@ gtk_entry_completion_changed (GtkWidget *widget,
gdk_threads_add_timeout (COMPLETION_TIMEOUT,
gtk_entry_completion_timeout,
completion);
g_source_set_name_by_id (completion->priv->completion_timeout, "[gtk+] gtk_entry_completion_timeout");
}
static gboolean
......
......@@ -1147,6 +1147,7 @@ gtk_expander_drag_motion (GtkWidget *widget,
if (!priv->expanded && !priv->expand_timer)
{
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;
......
......@@ -3653,6 +3653,7 @@ load_setup_timer (GtkFileChooserDefault *impl)
g_assert (priv->load_state != LOAD_PRELOAD);
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;
}
......
......@@ -1151,6 +1151,7 @@ gtk_file_system_model_got_files (GObject *object, GAsyncResult *res, gpointer da
thaw_func,
model,
NULL);
g_source_set_name_by_id (model->dir_thaw_source, "[gtk+] thaw_func");
}
for (walk = files; walk; walk = walk->next)
......
......@@ -2022,9 +2022,11 @@ gtk_icon_view_motion (GtkWidget *widget,
icon_view->priv->event_last_x = event->x;
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);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] rubberband_scroll_timeout");
}
}
else
remove_scroll_timeout (icon_view);
......@@ -6668,6 +6670,7 @@ gtk_icon_view_drag_motion (GtkWidget *widget,
icon_view->priv->scroll_timeout_id =
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"))
......
......@@ -1480,6 +1480,7 @@ animation_timeout (gpointer data)
priv->animation_timeout =
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);
}
......@@ -1500,9 +1501,11 @@ get_animation_frame (GtkImage *image)
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);
if (delay >= 0)
if (delay >= 0) {
priv->animation_timeout =
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
......
......@@ -3847,6 +3847,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
? MENU_SCROLL_TIMEOUT2
: MENU_SCROLL_TIMEOUT1,
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)
{
......@@ -3919,6 +3920,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
? MENU_SCROLL_TIMEOUT2
: MENU_SCROLL_TIMEOUT1,
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)
{
......@@ -4401,6 +4403,7 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu,
gtk_menu_stop_navigating_submenu_cb,
popdown_data,
(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,
priv->timer = gdk_threads_add_timeout (popup_delay,
gtk_menu_item_popup_timeout,
menu_item);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_menu_item_popup_timeout");
if (event &&
event->type != GDK_BUTTON_PRESS &&
......
......@@ -3459,6 +3459,7 @@ gtk_notebook_motion_notify (GtkWidget *widget,
priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
scroll_notebook_timer,
(gpointer) notebook);
g_source_set_name_by_id (priv->dnd_timer, "[gtk+] scroll_notebook_timer");
}
}
else
......@@ -3814,6 +3815,7 @@ gtk_notebook_drag_motion (GtkWidget *widget,
priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
gtk_notebook_switch_tab_timeout,
widget);
g_source_set_name_by_id (priv->switch_tab_timer, "[gtk+] gtk_notebook_switch_tab_timeout");
}
}
else
......@@ -4871,6 +4873,7 @@ gtk_notebook_timer (GtkNotebook *notebook)
priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) gtk_notebook_timer,
(gpointer) notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
}
else
retval = TRUE;
......@@ -4889,6 +4892,7 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
(GSourceFunc) gtk_notebook_timer,
(gpointer) notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
priv->need_timer = TRUE;
}
}
......
......@@ -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,
(GSourceFunc)gtk_path_bar_scroll_timeout,
path_bar);
g_source_set_name_by_id (path_bar->priv->timer, "[gtk+] gtk_path_bar_scroll_timeout");
}
else
retval = TRUE;
......@@ -1184,6 +1185,7 @@ gtk_path_bar_slider_button_press (GtkWidget *widget,
path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
(GSourceFunc)gtk_path_bar_scroll_timeout,
path_bar);
g_source_set_name_by_id (path_bar->priv->timer, "[gtk+] gtk_path_bar_scroll_timeout");
}
return FALSE;
......
......@@ -413,6 +413,7 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache,
cache->timeout_tag = g_timeout_add_seconds (BLOW_CACHE_TIMEOUT_SEC,
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,
view_rect, canvas_rect);
......
......@@ -1480,6 +1480,7 @@ check_switch_location_timer (GtkPlacesSidebar *sidebar, const char *uri)
if (uri != NULL) {
sidebar->drop_target_uri = g_strdup (uri);
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,
g_source_remove (sidebar->drag_leave_timeout_id);
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);
......
......@@ -205,6 +205,7 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
priv->start_y = priv->y;
priv->timeout =
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)
{
......@@ -233,6 +234,7 @@ gtk_press_and_hold_process_event (GtkPressAndHold *pah,
priv->start_y = priv->y;
priv->timeout =
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)
{
......
......@@ -512,10 +512,12 @@ win32_poll_status_timeout (GtkPrintOperation *op)
g_object_ref (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,
(GSourceFunc)win32_poll_status_timeout,
op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
}
g_object_unref (op);
return FALSE;
}
......@@ -558,6 +560,7 @@ win32_end_run (GtkPrintOperation *op,
op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout,
op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
}
else
/* Dunno what happened, pretend its finished */
......
......@@ -2985,6 +2985,7 @@ print_pages (GtkPrintOperation *op,
gdk_threads_add_timeout (SHOW_PROGRESS_TIME,
(GSourceFunc)show_progress_timeout,
data);
g_source_set_name_by_id (priv->show_progress_timeout_id, "[gtk+] show_progress_timeout");
data->progress = progress;
}
......
......@@ -4257,6 +4257,7 @@ initial_timeout (gpointer data)
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
second_timeout,
range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] second_timeout");
/* remove self */
return FALSE;
}
......@@ -4275,6 +4276,7 @@ gtk_range_add_step_timer (GtkRange *range,
priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
initial_timeout,
range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] initial_timeout");
priv->timer->step = step;
gtk_range_scroll (range, priv->timer->step);
......
......@@ -1394,7 +1394,10 @@ gtk_recent_manager_changed (GtkRecentManager *manager)
* schedule an emission immediately.
*/
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
{
manager->priv->changed_age += 1;
......
......@@ -1237,6 +1237,7 @@ cb_button_press (GtkWidget *widget,
priv->click_id = gdk_threads_add_timeout (priv->click_timeout,
cb_button_timeout,
button);
g_source_set_name_by_id (priv->click_id, "[gtk+] cb_button_timeout");
cb_button_timeout (button);
return TRUE;
......
......@@ -2742,10 +2742,13 @@ gtk_scrolled_window_captured_button_press (GtkWidget *widget,
/* Only set the timeout if we're going to store an event */
if (priv->capture_button_press)
priv->release_timeout_id =
gdk_threads_add_timeout (RELEASE_EVENT_TIMEOUT,
(GSourceFunc) gtk_scrolled_window_release_captured_event,
scrolled_window);
{
priv->release_timeout_id =
gdk_threads_add_timeout (RELEASE_EVENT_TIMEOUT,
(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;
......
......@@ -175,6 +175,7 @@ reset_timeout (GtkSearchEntry *entry)
priv->delayed_changed_id = g_timeout_add (DELAYED_TIMEOUT_ID,
gtk_search_entry_changed_timeout_cb,
entry);
g_source_set_name_by_id (priv->delayed_changed_id, "[gtk+] gtk_search_entry_changed_timeout_cb");
}
static void
......
......@@ -1051,6 +1051,7 @@ gtk_selection_convert (GtkWidget *widget,
GList *tmp_list;
GdkWindow *owner_window;
GdkDisplay *display;
guint id;
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (selection != GDK_NONE, FALSE);
......@@ -1131,8 +1132,9 @@ gtk_selection_convert (GtkWidget *widget,
current_retrievals = g_list_append (current_retrievals, info);
gdk_selection_convert (gtk_widget_get_window (widget), selection, target, time_);
gdk_threads_add_timeout (1000,
id = gdk_threads_add_timeout (1000,
(GSourceFunc) gtk_selection_retrieval_timeout, info);
g_source_set_name_by_id (id, "[gtk+] gtk_selection_retrieval_timeout");
return TRUE;
}
......@@ -2465,6 +2467,8 @@ _gtk_selection_request (GtkWidget *widget,
if (info->num_incrs > 0)
{
guint id;
/* FIXME: this could be dangerous if window doesn't still
exist */
......@@ -2476,7 +2480,8 @@ _gtk_selection_request (GtkWidget *widget,
gdk_window_get_events (info->requestor) |
GDK_PROPERTY_CHANGE_MASK);
current_incrs = g_list_append (current_incrs, info);
gdk_threads_add_timeout (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
id = gdk_threads_add_timeout (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
g_source_set_name_by_id (id, "[gtk+] gtk_selection_incr_timeout");
}
/* If it was a MULTIPLE request, set the property to indicate which
......
......@@ -1464,6 +1464,7 @@ start_spinning (GtkSpinButton *spin,
priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
(GSourceFunc) gtk_spin_button_timer,
(gpointer) spin);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
}
gtk_spin_button_real_spin (spin, click_child == priv->up_panel ? step : -step);
......@@ -1589,6 +1590,7 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT,
(GSourceFunc) gtk_spin_button_timer,
(gpointer) spin_button);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
}
else
{
......
......@@ -5588,14 +5588,18 @@ blink_cb (gpointer data)
priv->blink_timeout = 0;
}
else if (visible)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
text_view);
{
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
else
{
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
priv->blink_time += get_cursor_time (text_view);
}
......@@ -5646,6 +5650,7 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
else
......@@ -5677,6 +5682,7 @@ gtk_text_view_pend_cursor_blink (GtkTextView *text_view)
priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
blink_cb,
text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
......@@ -6930,6 +6936,7 @@ selection_motion_event_handler (GtkTextView *text_view,
text_view->priv->scroll_timeout =
gdk_threads_add_timeout (50, selection_scan_timeout, text_view);
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] selection_scan_timeout");
if (test_touchscreen || input_source == GDK_SOURCE_TOUCHSCREEN)
gtk_text_view_update_handles (text_view, GTK_TEXT_HANDLE_MODE_SELECTION);
......@@ -7605,8 +7612,11 @@ gtk_text_view_drag_motion (GtkWidget *widget,
priv->dnd_device = gdk_drag_context_get_device (context);
if (!priv->scroll_timeout)
{
priv->scroll_timeout =
gdk_threads_add_timeout (100, drag_scan_timeout, text_view);
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout");
}
/* TRUE return means don't propagate the drag motion to parent
* widgets that may also be drop sites.
......@@ -8942,6 +8952,7 @@ gtk_text_view_selection_bubble_popup_set (GtkTextView *text_view)
priv->selection_bubble_timeout_id =
gdk_threads_add_timeout (1000, gtk_text_view_selection_bubble_popup_cb,
text_view);
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_text_view_selection_bubble_popup_cb");
}
/* Child GdkWindows */
......
......@@ -1361,11 +1361,14 @@ gtk_tooltip_hide_tooltip (GtkTooltip *tooltip)
* we want to turn off browse mode
*/
if (!tooltip->browse_mode_timeout_id)
tooltip->browse_mode_timeout_id =
gdk_threads_add_timeout_full (0, timeout,
tooltip_browse_mode_expired,
g_object_ref (tooltip),
g_object_unref);
{
tooltip->browse_mode_timeout_id =
gdk_threads_add_timeout_full (0, timeout,
tooltip_browse_mode_expired,
g_object_ref (tooltip),
g_object_unref);
g_source_set_name_by_id (tooltip->browse_mode_timeout_id, "[gtk+] tooltip_browse_mode_expired");
}
}
else
{
......@@ -1430,6 +1433,7 @@ gtk_tooltip_start_delay (GdkDisplay *display)
tooltip_popup_timeout,
g_object_ref (display),
g_object_unref);
g_source_set_name_by_id (tooltip->timeout_id, "[gtk+] tooltip_popup_timeout");
}
void
......
......@@ -3690,6 +3690,7 @@ do_prelight (GtkTreeView *tree_view,
{
tree_view->priv->auto_expand_timeout =
gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->auto_expand_timeout, "[gtk+] auto_expand_timeout");
}
}
......@@ -7281,6 +7282,7 @@ add_scroll_timeout (GtkTreeView *tree_view)
{
tree_view->priv->scroll_timeout =
gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->scroll_timeout, "[gtk+] scroll_row_timeout");
}
}
......@@ -7837,6 +7839,7 @@ gtk_tree_view_drag_motion (GtkWidget *widget,
{
tree_view->priv->open_dest_timeout =
gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->open_dest_timeout, "[gtk+] open_row_timeout");
}
else
{
......@@ -11132,6 +11135,7 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view,
gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
/* Grab focus without selecting all the text. */
_gtk_entry_grab_focus (GTK_ENTRY (tree_view->priv->search_entry), FALSE);
......@@ -15030,6 +15034,7 @@ gtk_tree_view_search_preedit_changed (GtkIMContext *im_context,
gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
}
}
......@@ -15072,7 +15077,9 @@ static void
gtk_tree_view_search_enable_popdown (GtkWidget *widget,
gpointer data)
{
gdk_threads_add_timeout_full (G_PRIORITY_HIGH, 200, gtk_tree_view_real_search_enable_popdown, g_object_ref (data), g_object_unref);
guint id;
id = gdk_threads_add_timeout_full (G_PRIORITY_HIGH, 200, gtk_tree_view_real_search_enable_popdown, g_object_ref (data), g_object_unref);
g_source_set_name_by_id (id, "[gtk+] gtk_tree_view_real_search_enable_popdown");
}
static gboolean
......@@ -15132,6 +15139,7 @@ gtk_tree_view_search_scroll_event (GtkWidget *widget,
gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
}
return retval;
......@@ -15208,6 +15216,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
}
return retval;
......@@ -15460,6 +15469,7 @@ gtk_tree_view_search_init (GtkWidget *entry,
gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
}
if (*text == '\0')
......
......@@ -11556,6 +11556,7 @@ _gtk_window_schedule_mnemonics_visible (GtkWindow *window)
window->priv->mnemonics_display_timeout_id =
gdk_threads_add_timeout (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
g_source_set_name_by_id (window->priv->mnemonics_display_timeout_id, "[gtk+] schedule_mnemonics_visible_cb");
}
/**
......
......@@ -272,6 +272,7 @@ vfunc_filter_keypress (GtkIMContext *context, GdkEventKey *event)
multipress_context->timeout_id =
g_timeout_add_seconds (AUTOMATIC_COMPOSE_TIMEOUT,
&on_timeout, multipress_context);
g_source_set_name_by_id (multipress_context->timeout_id, "[gtk+] on_timeout");
return TRUE; /* key handled */
}
......
......@@ -1698,6 +1698,7 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
if (!done && data->job != NULL)
{
guint32 timeout;
guint id;
if (data->counter < 5)
timeout = 100;
......@@ -1706,7 +1707,8 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
else
timeout = 1000;
g_timeout_add (timeout, cups_job_info_poll_timeout, data);
id = g_timeout_add (timeout, cups_job_info_poll_timeout, data);
g_source_set_name_by_id (id, "[gtk+] cups_job_info_poll_timeout");
}
else
cups_job_poll_data_free (data);
......@@ -3227,6 +3229,7 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
cups_backend->list_printers_poll = gdk_threads_add_timeout (200,
(GSourceFunc) cups_request_printer_list,
cups_backend);
g_source_set_name_by_id (cups_backend->list_printers_poll, "[gtk+] cups_request_printer_list");
}
else if (cups_backend->list_printers_attempts != -1)
cups_backend->list_printers_attempts++;