diff --git a/gnome-panel/main.c b/gnome-panel/main.c index 966b35d..70a31fe 100644 --- a/gnome-panel/main.c +++ b/gnome-panel/main.c @@ -48,6 +48,8 @@ main (int argc, char **argv) GOptionContext *context; GnomeProgram *program; + panel_checkpoint ("Entering main()"); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); @@ -56,6 +58,7 @@ main (int argc, char **argv) g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); + panel_checkpoint ("main(): gnome_program_init()"); program = gnome_program_init ("gnome-panel", VERSION, LIBGNOMEUI_MODULE, argc, argv, @@ -63,26 +66,41 @@ main (int argc, char **argv) GNOME_PROGRAM_STANDARD_PROPERTIES, NULL); + panel_checkpoint ("main(): setting icon name"); gtk_window_set_default_icon_name (PANEL_ICON_PANEL); + panel_checkpoint ("main(): registering with bonobo-activation"); if (!panel_shell_register ()) return -1; + panel_checkpoint ("main(): initializing authentication manager"); gnome_authentication_manager_init (); + panel_checkpoint ("main(): initializing action protocol"); panel_action_protocol_init (); + + panel_checkpoint ("main(): initializing multiscreen"); panel_multiscreen_init (); + + panel_checkpoint ("main(): initializing stock icons"); panel_init_stock_icons_and_items (); + panel_checkpoint ("main(): initializing session"); panel_session_init (); + panel_checkpoint ("main(): setting up gconf monitoring"); gconf_client_add_dir (panel_gconf_get_client (), "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_NONE, NULL); + panel_checkpoint ("main(): loading global configuration"); panel_global_config_load (); + + panel_checkpoint ("main(): initializing lockdown"); panel_lockdown_init (); + + panel_checkpoint ("main(): loading profile"); panel_profile_load (); /*add forbidden lists to ALL panels*/ @@ -90,8 +108,10 @@ main (int argc, char **argv) (GFunc)panel_widget_add_forbidden, NULL); + panel_checkpoint ("main(): initializing X stuff"); xstuff_init (); + panel_checkpoint ("main(): entering main loop!"); gtk_main (); panel_lockdown_finalize (); diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c index 07688c8..7386b97 100644 --- a/gnome-panel/panel-applet-frame.c +++ b/gnome-panel/panel-applet-frame.c @@ -361,9 +361,11 @@ panel_applet_frame_load (const gchar *iid, CORBA_exception_init (&ev); + panel_checkpoint ("panel_applet_frame_load(): activating %s", iid); bonobo_activation_activate_from_id_async (iid, 0, (BonoboActivationCallback) panel_applet_frame_activated, frame_act, &ev); + panel_checkpoint ("panel_applet_frame_load(): waiting for async activation notification"); } void @@ -1263,6 +1265,8 @@ panel_applet_frame_activated (CORBA_Object object, frame_act = (PanelAppletFrameActivating *) data; frame = frame_act->frame; + panel_checkpoint ("panel_applet_frame_activated(): applet %s is active", frame->priv->iid); + /* according to the source of bonobo control == NULL && no exception can happen, so handle it */ if (error_reason != NULL || object == CORBA_OBJECT_NIL) { diff --git a/gnome-panel/panel-profile.c b/gnome-panel/panel-profile.c index 256b556..0bd8f2a 100644 --- a/gnome-panel/panel-profile.c +++ b/gnome-panel/panel-profile.c @@ -1649,17 +1649,24 @@ panel_profile_load_toplevel (GConfClient *client, if (!toplevel_id || !toplevel_id [0]) return NULL; + panel_checkpoint ("panel_profile_load_toplevel(): - gconf stuff"); + toplevel_dir = g_strdup_printf ("%s/toplevels/%s", profile_dir, toplevel_id); - if (!gconf_client_dir_exists (client, toplevel_dir, NULL)) + if (!gconf_client_dir_exists (client, toplevel_dir, NULL)) { + panel_checkpoint ("panel_profile_load_toplevel(): start associating schemas"); panel_gconf_associate_schemas_in_dir ( client, toplevel_dir, PANEL_SCHEMAS_DIR "/toplevels"); + panel_checkpoint ("panel_profile_load_toplevel(): end associating schemas"); + } + panel_checkpoint ("panel_profile_load_toplevel(): caching gconf toplevel dir"); gconf_client_add_dir (client, toplevel_dir, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + panel_checkpoint ("panel_profile_load_toplevel(): caching gconf background dir"); key = panel_gconf_sprintf ("%s/background", toplevel_dir); gconf_client_add_dir (client, key, @@ -1673,9 +1680,11 @@ panel_profile_load_toplevel (GConfClient *client, return NULL; } + panel_checkpoint ("panel_profile_load_toplevel(): creating toplevel object"); toplevel = g_object_new (PANEL_TYPE_TOPLEVEL, "screen", screen, NULL); + panel_checkpoint ("panel_profile_load_toplevel(): done creating toplevel object"); #define GET_INT(k, fn) \ { \ @@ -1777,8 +1786,10 @@ panel_profile_load_toplevel (GConfClient *client, GET_POSITION ("x", "x_right", "x_centered", x); GET_POSITION ("y", "y_bottom", "y_centered", y); + panel_checkpoint ("panel_profile_load_toplevel(): - loading background"); panel_profile_load_background (toplevel, client, toplevel_dir); + panel_checkpoint ("panel_profile_load_toplevel(): - setting toplevel id; final gconf stuff"); panel_profile_set_toplevel_id (toplevel, toplevel_id); panel_profile_connect_to_toplevel (toplevel); @@ -1803,8 +1814,10 @@ panel_profile_load_toplevel (GConfClient *client, g_free (toplevel_dir); + panel_checkpoint ("panel_profile_load_toplevel(): - panel_setup"); panel_setup (toplevel); + panel_checkpoint ("panel_profile_load_toplevel(): - end"); return toplevel; } @@ -1816,9 +1829,15 @@ panel_profile_load_and_show_toplevel (GConfClient *client, { PanelToplevel *toplevel; + panel_checkpoint ("panel_profile_load_and_show_toplevel(): start - loading toplevel"); + toplevel = panel_profile_load_toplevel (client, profile_dir, type, toplevel_id); - if (toplevel) + if (toplevel) { + panel_checkpoint ("panel_profile_load_toplevel(): showing toplevel"); gtk_widget_show (GTK_WIDGET (toplevel)); + } + + panel_checkpoint ("panel_profile_load_and_show_toplevel(): end"); } static void @@ -2477,33 +2496,46 @@ panel_profile_load (void) { GConfClient *client; + panel_checkpoint ("panel_profile_load(): getting gconf client"); client = panel_gconf_get_client (); + panel_checkpoint ("panel_profile_load(): copying old configuration"); panel_compatibility_maybe_copy_old_config (client); + panel_checkpoint ("panel_profile_load(): migrating ID list"); panel_compatibility_migrate_panel_id_list (client); + panel_checkpoint ("panel_profile_load(): caching /general directory"); gconf_client_add_dir (client, PANEL_CONFIG_DIR "/general", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + panel_checkpoint ("panel_profile_load(): loading config for toplevels"); panel_profile_load_list (client, PANEL_CONFIG_DIR, PANEL_GCONF_TOPLEVELS, panel_profile_load_and_show_toplevel, (GConfClientNotifyFunc) panel_profile_toplevel_id_list_notify); + + panel_checkpoint ("panel_profile_load(): loading config for objects"); panel_profile_load_list (client, PANEL_CONFIG_DIR, PANEL_GCONF_OBJECTS, panel_profile_load_object, (GConfClientNotifyFunc) panel_profile_object_id_list_notify); + + panel_checkpoint ("panel_profile_load(): loading config for applets"); panel_profile_load_list (client, PANEL_CONFIG_DIR, PANEL_GCONF_APPLETS, panel_profile_load_object, (GConfClientNotifyFunc) panel_profile_object_id_list_notify); + panel_checkpoint ("panel_profile_load(): ensuring toplevels"); panel_profile_ensure_toplevel_per_screen (client, PANEL_CONFIG_DIR); + panel_checkpoint ("panel_profile_load(): loading queued applets"); panel_applet_load_queued_applets (); + + panel_checkpoint ("panel_profile_load(): done"); } static gboolean diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c index d499440..9724b6a 100644 --- a/gnome-panel/panel-toplevel.c +++ b/gnome-panel/panel-toplevel.c @@ -46,6 +46,7 @@ #include "panel-struts.h" #include "panel-config-global.h" #include "panel-lockdown.h" +#include "panel-util.h" G_DEFINE_TYPE (PanelToplevel, panel_toplevel, GTK_TYPE_WINDOW); @@ -2892,6 +2893,8 @@ panel_toplevel_realize (GtkWidget *widget) { PanelToplevel *toplevel = (PanelToplevel *) widget; + panel_checkpoint ("panel_toplevel_realize(): start"); + gtk_window_set_decorated (GTK_WINDOW (widget), FALSE); gtk_window_stick (GTK_WINDOW (widget)); @@ -2905,6 +2908,8 @@ panel_toplevel_realize (GtkWidget *widget) gdk_window_set_geometry_hints (widget->window, NULL, GDK_HINT_POS); panel_toplevel_move_resize_window (toplevel, TRUE, TRUE); + + panel_checkpoint ("panel_toplevel_realize(): end"); } static void @@ -3006,6 +3011,8 @@ panel_toplevel_size_request (GtkWidget *widget, int position_changed = FALSE; int size_changed = FALSE; + panel_checkpoint ("panel_toplevel_size_request(): start"); + toplevel = PANEL_TOPLEVEL (widget); bin = GTK_BIN (widget); @@ -3031,6 +3038,8 @@ panel_toplevel_size_request (GtkWidget *widget, position_changed = TRUE; panel_toplevel_move_resize_window (toplevel, position_changed, size_changed); + + panel_checkpoint ("panel_toplevel_size_request(): end"); } static void @@ -3041,6 +3050,8 @@ panel_toplevel_size_allocate (GtkWidget *widget, GtkBin *bin = (GtkBin *) widget; GtkAllocation challoc; + panel_checkpoint ("panel_toplevel_size_allocate(): start"); + widget->allocation = *allocation; if (toplevel->priv->expand || @@ -3089,6 +3100,8 @@ panel_toplevel_size_allocate (GtkWidget *widget, if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) gtk_widget_size_allocate (bin->child, &challoc); + + panel_checkpoint ("panel_toplevel_size_allocate(): end"); } static gboolean @@ -3099,6 +3112,8 @@ panel_toplevel_expose (GtkWidget *widget, PanelFrameEdge edges; gboolean retval = FALSE; + panel_checkpoint ("panel_toplevel_expose(): start"); + if (!GTK_WIDGET_DRAWABLE (widget)) return retval; @@ -3191,6 +3206,8 @@ panel_toplevel_expose (GtkWidget *widget, GTK_ORIENTATION_VERTICAL); } + panel_checkpoint ("panel_toplevel_expose(): end"); + return retval; } diff --git a/gnome-panel/panel-util.c b/gnome-panel/panel-util.c index 08fcd16..d952c1d 100644 --- a/gnome-panel/panel-util.c +++ b/gnome-panel/panel-util.c @@ -39,6 +39,23 @@ #include "launcher.h" #include "panel-icon-names.h" +void +panel_checkpoint (const char *format, ...) +{ + va_list args; + char *str; + char *checkpoint_str; + + va_start (args, format); + str = g_strdup_vprintf (format, args); + checkpoint_str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), str); + + access (checkpoint_str, F_OK); + + g_free (str); + g_free (checkpoint_str); +} + int panel_ditem_launch (GnomeDesktopItem *item, GList *file_list, diff --git a/gnome-panel/panel-util.h b/gnome-panel/panel-util.h index 0d74d2d..dda340c 100644 --- a/gnome-panel/panel-util.h +++ b/gnome-panel/panel-util.h @@ -13,6 +13,8 @@ typedef void (*UpdateFunction) (gpointer); #define sure_string(s) ((const char *)((s)!=NULL?(s):"")) +void panel_checkpoint (const char *format, ...); + void panel_util_launch_from_key_file (GKeyFile *keyfile, GList *file_list, GdkScreen *screen,