diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-22 15:43:43 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-23 13:31:18 +0200 |
commit | 438cd857c49242244dda2923ac447f36464b9e72 (patch) | |
tree | 9b583fc07a430a739e80d62c73edede9ad019602 /gtk | |
parent | dcc0fd222e78372ce49a8722420ccc7e9e022cdd (diff) | |
download | gtk+-438cd857c49242244dda2923ac447f36464b9e72.tar.gz |
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
Diffstat (limited to 'gtk')
33 files changed, 106 insertions, 20 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 20b15a6183..9d73af0c31 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -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)); diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 81ed6e2324..1bc58bdd9a 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -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"); } } diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c index 30ecda489f..f218d66782 100644 --- a/gtk/gtkcellrenderertext.c +++ b/gtk/gtkcellrenderertext.c @@ -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 diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index e2c0ace928..7da643db5c 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -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)) { diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index b0d6055ad9..ceb0235d87 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -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; diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index e7cb5ebfd6..2f70465fc2 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -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"); } } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index d124b46c33..d19addb280 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -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); } } diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index c947210f7f..b62f81d134 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -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 diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index f725b05ffb..a9d728e30b 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -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; diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 2438b8b895..3e8a847ef6 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -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; } diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index 132902b317..df8c336494 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -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) diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 224f34dd70..7c19d2ee02 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -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")) diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 5128c0e35d..344972e94b 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -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 diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 304c42ff9b..6754565bc8 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -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"); } } diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index ec2d2bd4a7..e6430db1e5 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -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 && diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 2b0f914362..9e0944b3d7 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -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; } } diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 70f124d642..ec3364b724 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -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; diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c index ca6740f641..2c03330557 100644 --- a/gtk/gtkpixelcache.c +++ b/gtk/gtkpixelcache.c @@ -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); diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 5fa645204a..b93f7f4dbf 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -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); diff --git a/gtk/gtkpressandhold.c b/gtk/gtkpressandhold.c index 5635c6caf0..56cee8ac2c 100644 --- a/gtk/gtkpressandhold.c +++ b/gtk/gtkpressandhold.c @@ -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) { diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c index 123af8f8a4..e59eb9f675 100644 --- a/gtk/gtkprintoperation-win32.c +++ b/gtk/gtkprintoperation-win32.c @@ -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 */ diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c index 58d49a1b12..06ffc7f135 100644 --- a/gtk/gtkprintoperation.c +++ b/gtk/gtkprintoperation.c @@ -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; } diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 092dd4beef..3dea5b9a4e 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -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); diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index 7b8bb1acce..9cfdc7c125 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -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; diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 1208b04a0d..07f14de0f2 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -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; diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 54672bc51a..e60058b5e9 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -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; diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c index e05debb3b1..cf3af20e50 100644 --- a/gtk/gtksearchentry.c +++ b/gtk/gtksearchentry.c @@ -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 diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 80bdc80be1..84095c4216 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -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 diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 537a1565f9..694d59bcaf 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -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 { diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 101bc526b0..a2030c922b 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -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 */ diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 12e49ae950..7d8a6c5b82 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -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 diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index d228360120..f141e2f7b0 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -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') diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 03a3fcc8cf..32f5eeedff 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -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"); } /** |