Commit 0a27f7be authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Only present the window when the overview is complete

Change GsShell to emit a signal when the overview is fully populated,
and only present the window when that is emitted.

https://bugzilla.gnome.org/show_bug.cgi?id=707324
parent f5088117
......@@ -176,7 +176,8 @@ gs_application_startup (GApplication *application)
window = gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
gtk_application_add_window (GTK_APPLICATION (app), window);
gtk_window_present (window);
g_signal_connect_swapped (app->shell, "loaded",
G_CALLBACK (gtk_window_present), window);
}
static void
......
......@@ -60,6 +60,13 @@ struct GsShellPrivate
G_DEFINE_TYPE (GsShell, gs_shell, G_TYPE_OBJECT)
enum {
SIGNAL_LOADED,
SIGNAL_LAST
};
static guint signals [SIGNAL_LAST] = { 0 };
/**
* gs_shell_activate:
**/
......@@ -216,6 +223,8 @@ initial_overview_load_done (GsShellOverview *shell_overview, gpointer data)
gs_shell_updates_refresh (shell->priv->shell_updates, TRUE);
gs_shell_installed_refresh (shell->priv->shell_installed, TRUE);
g_signal_emit (shell, signals[SIGNAL_LOADED], 0);
}
static void
......@@ -496,6 +505,13 @@ gs_shell_class_init (GsShellClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gs_shell_finalize;
signals [SIGNAL_LOADED] =
g_signal_new ("loaded",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GsShellClass, loaded),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_type_class_add_private (klass, sizeof (GsShellPrivate));
}
......
......@@ -49,6 +49,8 @@ typedef struct
typedef struct
{
GObjectClass parent_class;
void (* loaded) (GsShell *shell);
} GsShellClass;
typedef enum {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment