[mutter] Name all timeouts and idles



commit d53e04f4c8d366ecfb107721231555abf74b4fee
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 10 18:58:58 2014 +0200

    Name all timeouts and idles
    
    Better names can be used once we make more use of them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727979

 src/backends/meta-monitor-manager.c        |    1 +
 src/backends/native/meta-weston-launch.c   |    5 ++++-
 src/backends/x11/meta-idle-monitor-xsync.c |    5 ++++-
 src/compositor/meta-window-actor.c         |    1 +
 src/core/bell.c                            |    6 ++++--
 src/core/display.c                         |    2 ++
 src/core/edge-resistance.c                 |    2 ++
 src/core/prefs.c                           |    7 +++++--
 src/core/screen.c                          |   12 +++++++++---
 src/core/util.c                            |    2 ++
 src/core/window.c                          |    4 ++++
 src/wayland/meta-xwayland.c                |    5 ++++-
 src/x11/window-x11.c                       |    2 ++
 13 files changed, 44 insertions(+), 10 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index a437c5f..58f56e7 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -931,6 +931,7 @@ meta_monitor_manager_handle_apply_configuration  (MetaDBusDisplayConfig *skeleto
   if (persistent)
     {
       manager->persistent_timeout_id = g_timeout_add_seconds (20, save_config_timeout, manager);
+      g_source_set_name_by_id (manager->persistent_timeout_id, "[mutter] save_config_timeout");
       g_signal_emit (manager, signals[CONFIRM_DISPLAY_CHANGE], 0);
     }
 
diff --git a/src/backends/native/meta-weston-launch.c b/src/backends/native/meta-weston-launch.c
index a77b2ea..135767b 100644
--- a/src/backends/native/meta-weston-launch.c
+++ b/src/backends/native/meta-weston-launch.c
@@ -101,6 +101,8 @@ send_message_to_wl (MetaLauncher           *self,
 
   while (reply.header.opcode != ((struct weston_launcher_message*)message)->opcode)
     {
+      guint id;
+
       /* There were events queued */
       g_assert ((reply.header.opcode & WESTON_LAUNCHER_EVENT) == WESTON_LAUNCHER_EVENT);
 
@@ -116,7 +118,8 @@ send_message_to_wl (MetaLauncher           *self,
       switch (reply.header.opcode)
        {
        case WESTON_LAUNCHER_SERVER_REQUEST_VT_SWITCH:
-         g_idle_add (request_vt_switch_idle, self);
+         id = g_idle_add (request_vt_switch_idle, self);
+         g_source_set_name_by_id (id, "[mutter] request_vt_switch_idle");
          break;
 
        default:
diff --git a/src/backends/x11/meta-idle-monitor-xsync.c b/src/backends/x11/meta-idle-monitor-xsync.c
index 25338a7..afcbd96 100644
--- a/src/backends/x11/meta-idle-monitor-xsync.c
+++ b/src/backends/x11/meta-idle-monitor-xsync.c
@@ -291,7 +291,10 @@ meta_idle_monitor_xsync_make_watch (MetaIdleMonitor           *monitor,
           g_hash_table_add (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm);
 
           if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec)
-            watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
+            {
+              watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
+              g_source_set_name_by_id (watch->idle_source_id, "[mutter] fire_watch_idle");
+            }
         }
       else
         {
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index ae5a276..33cd547 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -855,6 +855,7 @@ queue_send_frame_messages_timeout (MetaWindowActor *self)
   * to be drawn when the timer expires.
   */
   priv->send_frame_messages_timer = g_timeout_add_full (META_PRIORITY_REDRAW, offset, 
send_frame_messages_timeout, self, NULL);
+  g_source_set_name_by_id (priv->send_frame_messages_timer, "[mutter] send_frame_messages_timeout");
 }
 
 void
diff --git a/src/core/bell.c b/src/core/bell.c
index 0b1457b..96c8c1a 100644
--- a/src/core/bell.c
+++ b/src/core/bell.c
@@ -120,6 +120,7 @@ bell_unflash_frame (gpointer data)
 static void
 bell_flash_window_frame (MetaWindow *window)
 {
+  guint id;
   g_assert (window->frame != NULL);
   window->frame->is_flashing = 1;
   meta_frame_queue_draw (window->frame);
@@ -128,8 +129,9 @@ bell_flash_window_frame (MetaWindow *window)
    * we are guaranteed to get at least one frame drawn in the
    * flashed state, no matter how loaded we are.
    */
-  g_timeout_add_full (META_PRIORITY_REDRAW, 100,
-      bell_unflash_frame, window->frame, NULL);
+  id = g_timeout_add_full (META_PRIORITY_REDRAW, 100,
+        bell_unflash_frame, window->frame, NULL);
+  g_source_set_name_by_id (id, "[mutter] bell_unflash_frame");
 }
 
 /**
diff --git a/src/core/display.c b/src/core/display.c
index 4556389..a89b1be 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1466,6 +1466,7 @@ meta_display_queue_autoraise_callback (MetaDisplay *display,
                         meta_prefs_get_auto_raise_delay (),
                         window_raise_with_delay_callback,
                         window, NULL);
+  g_source_set_name_by_id (display->autoraise_timeout_id, "[mutter] window_raise_with_delay_callback");
   display->autoraise_window = window;
 }
 
@@ -2580,6 +2581,7 @@ meta_display_ping_window (MetaWindow        *window,
   ping_data->ping_timeout_id = g_timeout_add (PING_TIMEOUT_DELAY,
                                              meta_display_ping_timeout,
                                              ping_data);
+  g_source_set_name_by_id (ping_data->ping_timeout_id, "[mutter] meta_display_ping_timeout");
 
   display->pending_pings = g_slist_prepend (display->pending_pings, ping_data);
 
diff --git a/src/core/edge-resistance.c b/src/core/edge-resistance.c
index 8eb48a7..16e1858 100644
--- a/src/core/edge-resistance.c
+++ b/src/core/edge-resistance.c
@@ -437,6 +437,8 @@ apply_edge_resistance (MetaWindow                *window,
                     g_timeout_add (timeout_length_ms,
                                    edge_resistance_timeout,
                                    resistance_data);
+                  g_source_set_name_by_id (resistance_data->timeout_id,
+                                           "[mutter] edge_resistance_timeout");
                   resistance_data->timeout_setup = TRUE;
                   resistance_data->timeout_edge_pos = compare;
                   resistance_data->timeout_over = FALSE;
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 98d62ee..716967a 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -916,8 +916,11 @@ queue_changed (MetaPreference pref)
                 meta_preference_to_string (pref));
 
   if (changed_idle == 0)
-    changed_idle = g_idle_add_full (META_PRIORITY_PREFS_NOTIFY,
-                                    changed_idle_handler, NULL, NULL);
+    {
+      changed_idle = g_idle_add_full (META_PRIORITY_PREFS_NOTIFY,
+                                      changed_idle_handler, NULL, NULL);
+      g_source_set_name_by_id (changed_idle, "[mutter] changed_idle_handler");
+    }
 }
 
 
diff --git a/src/core/screen.c b/src/core/screen.c
index 2250dee..6cd3f3d 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1476,6 +1476,8 @@ meta_screen_update_tile_preview (MetaScreen *screen,
         g_timeout_add (TILE_PREVIEW_TIMEOUT_MS,
                        meta_screen_update_tile_preview_timeout,
                        screen);
+      g_source_set_name_by_id (screen->tile_preview_timeout_id,
+                               "[mutter] meta_screen_update_tile_preview_timeout");
     }
   else
     {
@@ -2681,9 +2683,13 @@ add_sequence (MetaScreen        *screen,
    * to compute exactly when we may next time out
    */
   if (screen->startup_sequence_timeout == 0)
-    screen->startup_sequence_timeout = g_timeout_add_seconds (1,
-                                                              startup_sequence_timeout,
-                                                              screen);
+    {
+      screen->startup_sequence_timeout = g_timeout_add_seconds (1,
+                                                                startup_sequence_timeout,
+                                                                screen);
+      g_source_set_name_by_id (screen->startup_sequence_timeout,
+                               "[mutter] startup_sequence_timeout");
+    }
 
   update_startup_feedback (screen);
 }
diff --git a/src/core/util.c b/src/core/util.c
index 3ac907f..73a822c 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -925,6 +925,7 @@ meta_later_add (MetaLaterType  when,
        * there so it will happen before GTK+ repaints.
        */
       later->source = g_idle_add_full (META_PRIORITY_RESIZE, call_idle_later, later, NULL);
+      g_source_set_name_by_id (later->source, "[mutter] call_idle_later");
       ensure_later_repaint_func ();
       break;
     case META_LATER_CALC_SHOWING:
@@ -935,6 +936,7 @@ meta_later_add (MetaLaterType  when,
       break;
     case META_LATER_IDLE:
       later->source = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, call_idle_later, later, NULL);
+      g_source_set_name_by_id (later->source, "[mutter] call_idle_later");
       break;
     }
 
diff --git a/src/core/window.c b/src/core/window.c
index 98f561a..cedd226 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -7351,6 +7351,8 @@ update_resize (MetaWindow *window,
        {
          window->display->grab_resize_timeout_id =
            g_timeout_add ((int)remaining, update_resize_timeout, window);
+         g_source_set_name_by_id (window->display->grab_resize_timeout_id,
+                                   "[mutter] update_resize_timeout");
        }
 
       return;
@@ -9275,6 +9277,8 @@ queue_focus_callback (MetaDisplay *display,
                         window_focus_on_pointer_rest_callback,
                         focus_data,
                         g_free);
+  g_source_set_name_by_id (display->focus_timeout_id,
+                           "[mutter] window_focus_on_pointer_rest_callback");
 }
 
 void
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index a4ec03f..856213c 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -114,6 +114,8 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window,
 
   if (!associate_window_with_surface_id (manager, window, surface_id))
     {
+      guint id;
+
       /* No surface ID yet... it should arrive after the next
        * iteration through the loop, so queue an idle and see
        * what happens.
@@ -122,7 +124,8 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window,
       op->manager = manager;
       op->window = window;
       op->surface_id = surface_id;
-      g_idle_add (associate_window_with_surface_idle, op);
+      id = g_idle_add (associate_window_with_surface_idle, op);
+      g_source_set_name_by_id (id, "[mutter] associate_window_with_surface_idle");
     }
 }
 
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 099a55d..6618b77 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -604,6 +604,8 @@ send_sync_request (MetaWindow *window)
   window->sync_request_timeout_id = g_timeout_add (1000,
                                                    sync_request_timeout,
                                                    window);
+  g_source_set_name_by_id (window->sync_request_timeout_id,
+                           "[mutter] sync_request_timeout");
 
   meta_compositor_set_updates_frozen (window->display->compositor, window,
                                       meta_window_updates_are_frozen (window));


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