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
This commit is contained in:
Bastien Nocera 2014-04-10 18:58:58 +02:00
parent b37223b9bb
commit d53e04f4c8
13 changed files with 44 additions and 10 deletions

View File

@ -931,6 +931,7 @@ meta_monitor_manager_handle_apply_configuration (MetaDBusDisplayConfig *skeleto
if (persistent) if (persistent)
{ {
manager->persistent_timeout_id = g_timeout_add_seconds (20, save_config_timeout, manager); 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); g_signal_emit (manager, signals[CONFIRM_DISPLAY_CHANGE], 0);
} }

View File

@ -101,6 +101,8 @@ send_message_to_wl (MetaLauncher *self,
while (reply.header.opcode != ((struct weston_launcher_message*)message)->opcode) while (reply.header.opcode != ((struct weston_launcher_message*)message)->opcode)
{ {
guint id;
/* There were events queued */ /* There were events queued */
g_assert ((reply.header.opcode & WESTON_LAUNCHER_EVENT) == WESTON_LAUNCHER_EVENT); 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) switch (reply.header.opcode)
{ {
case WESTON_LAUNCHER_SERVER_REQUEST_VT_SWITCH: 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; break;
default: default:

View File

@ -291,7 +291,10 @@ meta_idle_monitor_xsync_make_watch (MetaIdleMonitor *monitor,
g_hash_table_add (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm); g_hash_table_add (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm);
if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec) 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 else
{ {

View File

@ -855,6 +855,7 @@ queue_send_frame_messages_timeout (MetaWindowActor *self)
* to be drawn when the timer expires. * 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); 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 void

View File

@ -120,6 +120,7 @@ bell_unflash_frame (gpointer data)
static void static void
bell_flash_window_frame (MetaWindow *window) bell_flash_window_frame (MetaWindow *window)
{ {
guint id;
g_assert (window->frame != NULL); g_assert (window->frame != NULL);
window->frame->is_flashing = 1; window->frame->is_flashing = 1;
meta_frame_queue_draw (window->frame); 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 * we are guaranteed to get at least one frame drawn in the
* flashed state, no matter how loaded we are. * flashed state, no matter how loaded we are.
*/ */
g_timeout_add_full (META_PRIORITY_REDRAW, 100, id = g_timeout_add_full (META_PRIORITY_REDRAW, 100,
bell_unflash_frame, window->frame, NULL); bell_unflash_frame, window->frame, NULL);
g_source_set_name_by_id (id, "[mutter] bell_unflash_frame");
} }
/** /**

View File

@ -1466,6 +1466,7 @@ meta_display_queue_autoraise_callback (MetaDisplay *display,
meta_prefs_get_auto_raise_delay (), meta_prefs_get_auto_raise_delay (),
window_raise_with_delay_callback, window_raise_with_delay_callback,
window, NULL); window, NULL);
g_source_set_name_by_id (display->autoraise_timeout_id, "[mutter] window_raise_with_delay_callback");
display->autoraise_window = window; 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, ping_data->ping_timeout_id = g_timeout_add (PING_TIMEOUT_DELAY,
meta_display_ping_timeout, meta_display_ping_timeout,
ping_data); 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); display->pending_pings = g_slist_prepend (display->pending_pings, ping_data);

View File

@ -437,6 +437,8 @@ apply_edge_resistance (MetaWindow *window,
g_timeout_add (timeout_length_ms, g_timeout_add (timeout_length_ms,
edge_resistance_timeout, edge_resistance_timeout,
resistance_data); resistance_data);
g_source_set_name_by_id (resistance_data->timeout_id,
"[mutter] edge_resistance_timeout");
resistance_data->timeout_setup = TRUE; resistance_data->timeout_setup = TRUE;
resistance_data->timeout_edge_pos = compare; resistance_data->timeout_edge_pos = compare;
resistance_data->timeout_over = FALSE; resistance_data->timeout_over = FALSE;

View File

@ -916,8 +916,11 @@ queue_changed (MetaPreference pref)
meta_preference_to_string (pref)); meta_preference_to_string (pref));
if (changed_idle == 0) 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");
}
} }

View File

@ -1476,6 +1476,8 @@ meta_screen_update_tile_preview (MetaScreen *screen,
g_timeout_add (TILE_PREVIEW_TIMEOUT_MS, g_timeout_add (TILE_PREVIEW_TIMEOUT_MS,
meta_screen_update_tile_preview_timeout, meta_screen_update_tile_preview_timeout,
screen); screen);
g_source_set_name_by_id (screen->tile_preview_timeout_id,
"[mutter] meta_screen_update_tile_preview_timeout");
} }
else else
{ {
@ -2681,9 +2683,13 @@ add_sequence (MetaScreen *screen,
* to compute exactly when we may next time out * to compute exactly when we may next time out
*/ */
if (screen->startup_sequence_timeout == 0) if (screen->startup_sequence_timeout == 0)
screen->startup_sequence_timeout = g_timeout_add_seconds (1, {
startup_sequence_timeout, screen->startup_sequence_timeout = g_timeout_add_seconds (1,
screen); startup_sequence_timeout,
screen);
g_source_set_name_by_id (screen->startup_sequence_timeout,
"[mutter] startup_sequence_timeout");
}
update_startup_feedback (screen); update_startup_feedback (screen);
} }

View File

@ -925,6 +925,7 @@ meta_later_add (MetaLaterType when,
* there so it will happen before GTK+ repaints. * there so it will happen before GTK+ repaints.
*/ */
later->source = g_idle_add_full (META_PRIORITY_RESIZE, call_idle_later, later, NULL); 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 (); ensure_later_repaint_func ();
break; break;
case META_LATER_CALC_SHOWING: case META_LATER_CALC_SHOWING:
@ -935,6 +936,7 @@ meta_later_add (MetaLaterType when,
break; break;
case META_LATER_IDLE: case META_LATER_IDLE:
later->source = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, call_idle_later, later, NULL); 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; break;
} }

View File

@ -7351,6 +7351,8 @@ update_resize (MetaWindow *window,
{ {
window->display->grab_resize_timeout_id = window->display->grab_resize_timeout_id =
g_timeout_add ((int)remaining, update_resize_timeout, window); 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; return;
@ -9275,6 +9277,8 @@ queue_focus_callback (MetaDisplay *display,
window_focus_on_pointer_rest_callback, window_focus_on_pointer_rest_callback,
focus_data, focus_data,
g_free); g_free);
g_source_set_name_by_id (display->focus_timeout_id,
"[mutter] window_focus_on_pointer_rest_callback");
} }
void void

View File

@ -114,6 +114,8 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window,
if (!associate_window_with_surface_id (manager, window, surface_id)) if (!associate_window_with_surface_id (manager, window, surface_id))
{ {
guint id;
/* No surface ID yet... it should arrive after the next /* No surface ID yet... it should arrive after the next
* iteration through the loop, so queue an idle and see * iteration through the loop, so queue an idle and see
* what happens. * what happens.
@ -122,7 +124,8 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window,
op->manager = manager; op->manager = manager;
op->window = window; op->window = window;
op->surface_id = surface_id; 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");
} }
} }

View File

@ -604,6 +604,8 @@ send_sync_request (MetaWindow *window)
window->sync_request_timeout_id = g_timeout_add (1000, window->sync_request_timeout_id = g_timeout_add (1000,
sync_request_timeout, sync_request_timeout,
window); 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_compositor_set_updates_frozen (window->display->compositor, window,
meta_window_updates_are_frozen (window)); meta_window_updates_are_frozen (window));