[gtk+] Add names to more sources



commit 98089778df1c9a5cdef349feaab573fc3ca7d1f6
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 13 09:03:40 2017 -0400

    Add names to more sources
    
    This makes debugging mainloop-related issues more pleasant.

 gdk/x11/gdkdnd-x11.c       |    8 +++++---
 gtk/gtkentrycompletion.c   |    1 +
 gtk/gtkgesturelongpress.c  |    6 ++----
 gtk/gtkgesturemultipress.c |    8 ++++----
 gtk/gtkscrolledwindow.c    |    7 ++++++-
 5 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index bd3040b..6841d0a 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -2620,6 +2620,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
   cairo_surface_t *win_surface;
   cairo_surface_t *surface;
   cairo_t *cr;
+  guint id;
 
   if (success)
     {
@@ -2652,9 +2653,10 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
   anim->frame_clock = gdk_window_get_frame_clock (x11_context->drag_window);
   anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
 
-  gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
-                                gdk_drag_anim_timeout, anim,
-                                (GDestroyNotify) gdk_drag_anim_destroy);
+  id = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
+                                     gdk_drag_anim_timeout, anim,
+                                     (GDestroyNotify) gdk_drag_anim_destroy);
+  g_source_set_name_by_id (id, "[gtk+] gdk_drag_anim_timeout");
 }
 
 static gboolean
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 6b45e67..b18616b 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -2603,6 +2603,7 @@ completion_insert_text_callback (GtkEntry           *entry,
                             g_cclosure_new_object (G_CALLBACK (check_completion_callback),
                                                    G_OBJECT (completion)));
       g_source_attach (completion->priv->check_completion_idle, NULL);
+      g_source_set_name (completion->priv->check_completion_idle, "[gtk+] check_completion_callback");
     }
 }
 
diff --git a/gtk/gtkgesturelongpress.c b/gtk/gtkgesturelongpress.c
index 8cbcce7..de4ff79 100644
--- a/gtk/gtkgesturelongpress.c
+++ b/gtk/gtkgesturelongpress.c
@@ -137,10 +137,8 @@ gtk_gesture_long_press_begin (GtkGesture       *gesture,
 
   gtk_gesture_get_point (gesture, sequence,
                          &priv->initial_x, &priv->initial_y);
-  priv->timeout_id =
-    gdk_threads_add_timeout (delay,
-                             _gtk_gesture_long_press_timeout,
-                             gesture);
+  priv->timeout_id = gdk_threads_add_timeout (delay, _gtk_gesture_long_press_timeout, gesture);
+  g_source_set_name_by_id (priv->timeout_id, "[gtk+] _gtk_gesture_long_press_timeout");
 }
 
 static void
diff --git a/gtk/gtkgesturemultipress.c b/gtk/gtkgesturemultipress.c
index c612735..e0816cf 100644
--- a/gtk/gtkgesturemultipress.c
+++ b/gtk/gtkgesturemultipress.c
@@ -150,10 +150,10 @@ _gtk_gesture_multi_press_update_timeout (GtkGestureMultiPress *gesture)
   settings = gtk_widget_get_settings (widget);
   g_object_get (settings, "gtk-double-click-time", &double_click_time, NULL);
 
-  priv->double_click_timeout_id =
-    gdk_threads_add_timeout (double_click_time,
-                             _double_click_timeout_cb,
-                             gesture);
+  priv->double_click_timeout_id = gdk_threads_add_timeout (double_click_time,
+                                                           _double_click_timeout_cb,
+                                                           gesture);
+  g_source_set_name_by_id (priv->double_click_timeout_id, "[gtk+] _double_click_timeout_cb");
 }
 
 static gboolean
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 5310eac..f791303 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1148,7 +1148,10 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
   if (on_scrollbar)
     indicator_set_over (indicator, TRUE);
   else if (indicator_close && !on_other_scrollbar)
-    indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+    {
+      indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+      g_source_set_name_by_id (indicator->over_timeout_id, "[gtk+] enable_over_timeout_cb");
+    }
   else
     indicator_set_over (indicator, FALSE);
 
@@ -3759,7 +3762,9 @@ indicator_set_fade (Indicator *indicator,
 
   if (visible)
     {
+if (indicator->conceil_timer != 0) g_print ("leaking conceil_timer!\n");
       indicator->conceil_timer = g_timeout_add (INDICATOR_FADE_OUT_TIME, maybe_hide_indicator, indicator);
+      g_source_set_name_by_id (indicator->conceil_timer, "[gtk+] maybe_hide_indicator");
     }
   if (!visible && gtk_widget_get_mapped (indicator->scrollbar) &&
       indicator->conceil_timer != 0)


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