[gnome-builder] app: ensure task completes when focusing existing workbench



commit 616b40c853ba8b38a057e9bebc3eacbdc625e92e
Author: Christian Hergert <christian hergert me>
Date:   Thu Apr 23 14:56:33 2015 -0700

    app: ensure task completes when focusing existing workbench

 src/app/gb-application.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 09c34d0..6bc5bf5 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -312,6 +312,8 @@ gb_application_open_project_async (GbApplication       *self,
   g_return_if_fail (G_IS_FILE (file));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
 
+  task = g_task_new (self, cancellable, callback, user_data);
+
   windows = gtk_application_get_windows (GTK_APPLICATION (self));
 
   for (iter = windows; iter; iter = iter->next)
@@ -331,14 +333,13 @@ gb_application_open_project_async (GbApplication       *self,
               if (g_file_equal (file, project_file))
                 {
                   gtk_window_present (iter->data);
+                  g_task_return_boolean (task, TRUE);
                   return;
                 }
             }
         }
     }
 
-  task = g_task_new (self, cancellable, callback, user_data);
-
   if (additional_files)
     ar = g_ptr_array_ref (additional_files);
   else


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