From eb9c61f3e0ce82159d5040ee584e7d31ce7df8cc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 12 Apr 2013 21:18:00 -0400 Subject: [PATCH] network: Avoid jumping dialogs The connection editor window is shown before all of its pages are initialized, causing it to jump when it gets its final size. Avoid that by not showing it before it is ready. https://bugzilla.gnome.org/show_bug.cgi?id=693781 --- panels/network/connection-editor/net-connection-editor.c | 7 +++++++ panels/network/connection-editor/net-connection-editor.h | 1 + 2 files changed, 8 insertions(+) diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c index cf6faee8f..5f53a872b 100644 --- a/panels/network/connection-editor/net-connection-editor.c +++ b/panels/network/connection-editor/net-connection-editor.c @@ -392,6 +392,9 @@ recheck_initialization (NetConnectionEditor *editor) notebook = GTK_NOTEBOOK (gtk_builder_get_object (editor->builder, "details_notebook")); gtk_notebook_set_current_page (notebook, 0); + if (editor->show_when_initialized) + gtk_window_present (GTK_WINDOW (editor->window)); + g_idle_add (idle_validate, editor); } @@ -930,6 +933,10 @@ net_connection_editor_new (GtkWindow *parent_window, void net_connection_editor_present (NetConnectionEditor *editor) { + if (!editor_is_initialized (editor)) { + editor->show_when_initialized = TRUE; + return; + } gtk_window_present (GTK_WINDOW (editor->window)); } diff --git a/panels/network/connection-editor/net-connection-editor.h b/panels/network/connection-editor/net-connection-editor.h index 6d08925f1..d3fdd9afb 100644 --- a/panels/network/connection-editor/net-connection-editor.h +++ b/panels/network/connection-editor/net-connection-editor.h @@ -66,6 +66,7 @@ struct _NetConnectionEditor NMClientPermissionResult can_modify; gboolean title_set; + gboolean show_when_initialized; }; struct _NetConnectionEditorClass