[gnome-builder/wip/vim] app: cleanup how we present the window



commit d27dec33c487be4140874102c32b5ac24f382b54
Author: Christian Hergert <christian hergert me>
Date:   Thu Oct 2 17:13:36 2014 -0700

    app: cleanup how we present the window

 src/app/gb-application.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 1f74d53..b7c1086 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -179,7 +179,6 @@ gb_application_create_workbench (GApplication *application)
                          NULL);
 
   gtk_window_maximize (window);
-  gtk_window_present (window);
 
   gtk_application_add_window (GTK_APPLICATION (application), window);
 
@@ -189,7 +188,25 @@ gb_application_create_workbench (GApplication *application)
 static void
 gb_application_activate (GApplication *application)
 {
-  (void)gb_application_create_workbench (application);
+  GbWorkbench *workbench;
+  GList *list;
+
+  g_return_if_fail (GB_IS_APPLICATION (application));
+
+  list = gtk_application_get_windows (GTK_APPLICATION (application));
+
+  for (; list; list = list->next)
+    {
+      if (GB_IS_WORKBENCH (list->data))
+        {
+          gtk_window_present (GTK_WINDOW (list->data));
+          return;
+        }
+    }
+
+  workbench = gb_application_create_workbench (application);
+
+  gtk_window_present (GTK_WINDOW (workbench));
 }
 
 static void
@@ -219,6 +236,8 @@ gb_application_open (GApplication   *application,
   if (!workbench)
     workbench = GB_WORKBENCH (gb_application_create_workbench (application));
 
+  gtk_window_present (GTK_WINDOW (workbench));
+
   workspace = gb_workbench_get_workspace (workbench,
                                           GB_TYPE_EDITOR_WORKSPACE);
 


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