diff options
author | Thomas Wood <thomas.wood@intel.com> | 2010-03-23 10:07:09 +0000 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2010-03-23 10:07:09 +0000 |
commit | 3fd64e28cda0afdeead8b0bb40d765b015de7d79 (patch) | |
tree | 5eff1dae65055881e898bdbdb4300f1ac1587f36 | |
parent | 9c38586a28fa2717630b8183b1bd1f7ba0a4c29d (diff) | |
download | gnome-control-center-3fd64e28cda0afdeead8b0bb40d765b015de7d79.tar.gz |
keyboard: initialise the panel only when first activated
This improves the shell start up time by not initialising the panel at
the time the extension is loaded. Instead, initialisation can be done when
the panel is first activated.
-rw-r--r-- | capplets/keyboard/cc-keyboard-panel.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/capplets/keyboard/cc-keyboard-panel.c b/capplets/keyboard/cc-keyboard-panel.c index 140dd53df..4f70a86de 100644 --- a/capplets/keyboard/cc-keyboard-panel.c +++ b/capplets/keyboard/cc-keyboard-panel.c @@ -100,11 +100,18 @@ on_notebook_switch_page (GtkNotebook *notebook, } static void -setup_panel (CcKeyboardPanel *panel) +setup_panel (CcKeyboardPanel *panel, + gboolean is_active) { + static gboolean initialised = FALSE; GtkWidget *label; char *display_name; + if (initialised) + return; + + initialised = TRUE; + panel->priv->notebook = gtk_notebook_new (); g_signal_connect (panel->priv->notebook, "switch-page", @@ -157,8 +164,6 @@ cc_keyboard_panel_constructor (GType type, "id", "keyboard.desktop", NULL); - setup_panel (keyboard_panel); - return G_OBJECT (keyboard_panel); } @@ -194,6 +199,11 @@ cc_keyboard_panel_init (CcKeyboardPanel *panel) gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); g_object_unref (client); + + + g_signal_connect (panel, "active-changed", G_CALLBACK (setup_panel), + NULL); + } static void |