[gtk+] all: Add names to timeouts



commit 438cd857c49242244dda2923ac447f36464b9e72
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Oct 22 15:43:43 2013 +0200

    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

 gdk/gdkframeclockidle.c                          |    2 +
 gdk/wayland/gdkdevice-wayland.c                  |    3 ++
 gdk/x11/gdkapplaunchcontext-x11.c                |    8 ++++-
 gtk/gtkbutton.c                                  |    1 +
 gtk/gtkcalendar.c                                |    2 +
 gtk/gtkcellrenderertext.c                        |    1 +
 gtk/gtkclipboard.c                               |    1 +
 gtk/gtkcombobox.c                                |    4 ++-
 gtk/gtkdnd.c                                     |    1 +
 gtk/gtkentry.c                                   |    6 ++++
 gtk/gtkentrycompletion.c                         |    1 +
 gtk/gtkexpander.c                                |    1 +
 gtk/gtkfilechooserdefault.c                      |    1 +
 gtk/gtkfilesystemmodel.c                         |    1 +
 gtk/gtkiconview.c                                |    5 ++-
 gtk/gtkimage.c                                   |    5 ++-
 gtk/gtkmenu.c                                    |    3 ++
 gtk/gtkmenuitem.c                                |    1 +
 gtk/gtknotebook.c                                |    4 ++
 gtk/gtkpathbar.c                                 |    2 +
 gtk/gtkpixelcache.c                              |    1 +
 gtk/gtkplacessidebar.c                           |    2 +
 gtk/gtkpressandhold.c                            |    2 +
 gtk/gtkprintoperation-win32.c                    |    5 ++-
 gtk/gtkprintoperation.c                          |    1 +
 gtk/gtkrange.c                                   |    2 +
 gtk/gtkrecentmanager.c                           |    5 ++-
 gtk/gtkscalebutton.c                             |    1 +
 gtk/gtkscrolledwindow.c                          |   11 ++++--
 gtk/gtksearchentry.c                             |    1 +
 gtk/gtkselection.c                               |    9 ++++-
 gtk/gtkspinbutton.c                              |    2 +
 gtk/gtktextview.c                                |   17 +++++++++--
 gtk/gtktooltip.c                                 |   14 ++++++---
 gtk/gtktreeview.c                                |   12 +++++++-
 gtk/gtkwindow.c                                  |    1 +
 modules/input/gtkimcontextmultipress.c           |    1 +
 modules/printbackends/cups/gtkprintbackendcups.c |   33 +++++++++++++++------
 38 files changed, 141 insertions(+), 32 deletions(-)
---
diff --git a/gdk/gdkframeclockidle.c b/gdk/gdkframeclockidle.c
index b4ef050..c90bd09 100644
--- a/gdk/gdkframeclockidle.c
+++ b/gdk/gdkframeclockidle.c
@@ -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");
         }
     }
 }
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 68bfcac..67aae7e 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -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;
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index 6aa1711..18a3e7e 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -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");
+  }
 }
 
 
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 20b15a6..9d73af0 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 81ed6e2..1bc58bd 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 30ecda4..f218d66 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 e2c0ace..7da643d 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 b0d6055..ceb0235 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 e7cb5eb..2f70465 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 d124b46..d19addb 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 c947210..b62f81d 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 f725b05..a9d728e 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 2438b8b..3e8a847 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 132902b..df8c336 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 224f34d..7c19d2e 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 5128c0e..344972e 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 304c42f..6754565 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 ec2d2bd..e6430db 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 2b0f914..9e0944b 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 70f124d..ec3364b 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 ca6740f..2c03330 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 5fa6452..b93f7f4 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 5635c6c..56cee8a 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 123af8f..e59eb9f 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 58d49a1..06ffc7f 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 092dd4b..3dea5b9 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 7b8bb1a..9cfdc7c 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 1208b04..07f14de 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 54672bc..e60058b 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 e05debb..cf3af20 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 80bdc80..84095c4 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 537a156..694d59b 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 101bc52..a2030c9 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 12e49ae..7d8a6c5 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 d228360..f141e2f 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 03a3fcc..32f5eee 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");
 }
 
 /**
diff --git a/modules/input/gtkimcontextmultipress.c b/modules/input/gtkimcontextmultipress.c
index d22707b..9cfe028 100644
--- a/modules/input/gtkimcontextmultipress.c
+++ b/modules/input/gtkimcontextmultipress.c
@@ -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 */
         }
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c 
b/modules/printbackends/cups/gtkprintbackendcups.c
index ff8bb7f..9090733 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -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++;
@@ -3273,9 +3276,12 @@ cups_get_printer_list (GtkPrintBackend *backend)
   if (cups_backend->list_printers_poll == 0)
     {
       if (cups_request_printer_list (cups_backend))
-        cups_backend->list_printers_poll = gdk_threads_add_timeout (50,
-                                             (GSourceFunc) cups_request_printer_list,
-                                             backend);
+        {
+          cups_backend->list_printers_poll = gdk_threads_add_timeout (50,
+                                               (GSourceFunc) cups_request_printer_list,
+                                               backend);
+          g_source_set_name_by_id (cups_backend->list_printers_poll, "[gtk+] cups_request_printer_list");
+        }
 
 #ifdef HAVE_CUPS_API_1_6
       avahi_request_printer_list (cups_backend);
@@ -3387,6 +3393,7 @@ cups_request_ppd (GtkPrinter *printer)
               cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (200,
                                                     (GSourceFunc) cups_request_ppd,
                                                     printer);
+              g_source_set_name_by_id (cups_printer->get_remote_ppd_poll, "[gtk+] cups_request_ppd");
             }
           else if (cups_printer->get_remote_ppd_attempts != -1)
             cups_printer->get_remote_ppd_attempts++;
@@ -3652,9 +3659,12 @@ cups_get_default_printer (GtkPrintBackendCups *backend)
   if (cups_backend->default_printer_poll == 0)
     {
       if (cups_request_default_printer (cups_backend))
-        cups_backend->default_printer_poll = gdk_threads_add_timeout (200,
-                                               (GSourceFunc) cups_request_default_printer,
-                                               backend);
+        {
+          cups_backend->default_printer_poll = gdk_threads_add_timeout (200,
+                                                 (GSourceFunc) cups_request_default_printer,
+                                                 backend);
+          g_source_set_name_by_id (cups_backend->default_printer_poll, "[gtk+] 
cups_request_default_printer");
+        }
     }
 }
 
@@ -3785,9 +3795,12 @@ cups_printer_request_details (GtkPrinter *printer)
               cups_printer->remote_cups_connection_test = gtk_cups_connection_test_new 
(cups_printer->hostname);
 
               if (cups_request_ppd (printer))
-                cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (50,
-                                                    (GSourceFunc) cups_request_ppd,
-                                                    printer);
+                {
+                  cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (50,
+                                                      (GSourceFunc) cups_request_ppd,
+                                                      printer);
+                  g_source_set_name_by_id (cups_printer->get_remote_ppd_poll, "[gtk+] cups_request_ppd");
+                }
             }
         }
       else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]