[gnome-builder/gnome-builder-3-26] workbench: hide workbench before unloading



commit ea122859d6418cd3360c5f913c6072b0e53bf0ac
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 26 14:10:11 2017 -0700

    workbench: hide workbench before unloading
    
    We risk flickering between perspectives as they are unloaded if we perform
    the unload before hiding the window. This instead hides the window first
    and lets that rapid shutdown procedure happen immediately afterwards.

 libide/workbench/ide-workbench.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/libide/workbench/ide-workbench.c b/libide/workbench/ide-workbench.c
index ef0fde4..bbae014 100644
--- a/libide/workbench/ide-workbench.c
+++ b/libide/workbench/ide-workbench.c
@@ -171,9 +171,23 @@ ide_workbench_delete_event (GtkWidget   *widget,
 
   self->unloading = TRUE;
 
-  g_clear_object (&self->addins);
+  /* Notify any listeners we are beginning the unload procedure */
   g_signal_emit (self, signals [UNLOAD], 0, self->context);
 
+  /*
+   * We are going to cheat here immediately hide the window and then
+   * close things in the background so it feels like we are doing the
+   * shutdown faster than we really are. It also avoids flickering
+   * between perspectives as part of the shutdown procedure.
+   */
+  gtk_widget_hide (GTK_WIDGET (self));
+
+  /*
+   * Now start unloading addins, which will cascade into the removal
+   * of perspectives and other bits and pieces (like editor addins).
+   */
+  g_clear_object (&self->addins);
+
   if (self->context != NULL)
     {
       self->cancellable = g_cancellable_new ();


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