[gnome-control-center/single-window-shell] [shell] switch to the capplet after a delay



commit 3838b65f1c3df3641851439d1f627949aaa9466d
Author: Thomas Wood <thomas wood intel com>
Date:   Mon Jan 11 16:34:15 2010 +0000

    [shell] switch to the capplet after a delay
    
    If the notebook is switched to the capplet page too quickly, a black filled
    rectangle appears briefly.
    
    This should be fixed properly in the future by adjusting the capplets so
    that they only plug into the socket when fully ready.

 shell/control-center.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/shell/control-center.c b/shell/control-center.c
index 0ce0050..26acaf7 100644
--- a/shell/control-center.c
+++ b/shell/control-center.c
@@ -178,6 +178,14 @@ fill_model (GtkBuilder *b)
 
 }
 
+static gboolean
+switch_after_delay (GtkNotebook *notebook)
+{
+  gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
+
+  return FALSE;
+}
+
 void
 plug_added_cb (GtkSocket  *socket,
                GtkBuilder *builder)
@@ -187,7 +195,9 @@ plug_added_cb (GtkSocket  *socket,
 
   notebook = W (builder, "notebook");
 
-  gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
+  /* FIXME: this shouldn't be necassary if the capplet doesn't add to the socket
+   * until it is fully ready */
+  g_timeout_add (100, switch_after_delay, notebook);
 
   /* make sure no items are selected when the user switches back to the icon
    * views */



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