[gnome-builder] workbench: hide workbench before unloading



commit 30183f7ade5129d19bf14c30a9d7184854fd6b8a
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.

 src/libide/workbench/ide-workbench.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/libide/workbench/ide-workbench.c b/src/libide/workbench/ide-workbench.c
index 0855919..7dc26ab 100644
--- a/src/libide/workbench/ide-workbench.c
+++ b/src/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]