[gnome-disk-utility] Avoid flashes, by not deferring window setup to idle



commit dc5fe657efb607fafc41f9ceb96c11d23aee3d92
Author: David Zeuthen <zeuthen gmail com>
Date:   Wed Oct 10 17:39:03 2012 -0400

    Avoid flashes, by not deferring window setup to idle
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 src/disks/gduapplication.c |    2 +-
 src/disks/gduwindow.c      |   16 +++++-----------
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/disks/gduapplication.c b/src/disks/gduapplication.c
index 01972da..1f54d0a 100644
--- a/src/disks/gduapplication.c
+++ b/src/disks/gduapplication.c
@@ -84,7 +84,7 @@ gdu_application_activate (GApplication *_app)
   app->window = gdu_window_new (app, app->client);
   gtk_application_add_window (GTK_APPLICATION (app),
                               GTK_WINDOW (app->window));
-  gtk_widget_show_all (GTK_WIDGET (app->window));
+  gtk_widget_show (GTK_WIDGET (app->window));
 
  out:
   ;
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index 0919148..8094c2f 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -1065,16 +1065,6 @@ init_css (GduWindow *window)
 }
 
 
-static gboolean
-on_constructed_in_idle (gpointer user_data)
-{
-  GduWindow *window = GDU_WINDOW (user_data);
-  /* select something sensible */
-  ensure_something_selected (window);
-  device_tree_selection_toolbar_select_done_toggle (window, FALSE);
-  return FALSE; /* remove source */
-}
-
 static gint
 device_sort_function (GtkTreeModel *model,
                       GtkTreeIter *a,
@@ -1362,6 +1352,7 @@ gdu_window_constructed (GObject *object)
   /* set up non-standard widgets that isn't in the .ui file */
 
   window->volume_grid = gdu_volume_grid_new (window->client);
+  gtk_widget_show (window->volume_grid);
   gtk_box_pack_start (GTK_BOX (window->devtab_grid_hbox),
                       window->volume_grid,
                       TRUE, TRUE, 0);
@@ -1542,7 +1533,10 @@ gdu_window_constructed (GObject *object)
                     G_CALLBACK (on_activate_link),
                     window);
 
-  g_idle_add (on_constructed_in_idle, g_object_ref (window));
+  ensure_something_selected (window);
+  device_tree_selection_toolbar_select_done_toggle (window, FALSE);
+  gtk_widget_grab_focus (window->device_tree_treeview);
+  update_all (window);
 }
 
 static void



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