[gnome-control-center/gnome-3-8] network: Avoid jumping dialogs



commit 8cc5caf8a779ba231d3f06799f0490c1e6b0a318
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 12 21:18:00 2013 -0400

    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 cf6faee..5f53a87 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 6d08925..d3fdd9a 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


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