psppire-output-view: Only render output items once the window is realized.
[pspp] / src / ui / gui / psppire-output-window.c
index 074f90a88be77477ac9d9f8e095b058801464fad..3c889808a32004551c08f45ec49b865a45d69c30 100644 (file)
@@ -139,17 +139,27 @@ psppire_output_submit (struct output_driver *this,
 {
   struct psppire_output_driver *pod = psppire_output_cast (this);
   PsppireOutputWindow *window;
+  bool new;
 
-  if (pod->window == NULL)
+  new = pod->window == NULL;
+  if (new)
     {
       pod->window = PSPPIRE_OUTPUT_WINDOW (psppire_output_window_new ());
-      gtk_widget_show_all (GTK_WIDGET (pod->window));
       pod->window->driver = pod;
     }
   window = pod->window;
 
   psppire_output_view_put (window->view, item);
 
+  if (new)
+    {
+      /* We could have called this earlier in the previous "if (new)" block,
+         but doing it here finds, in a plain GTK+ environment, a bug that
+         otherwise only showed up on an Ubuntu Unity desktop.  See bug
+         #43362. */
+      gtk_widget_show_all (GTK_WIDGET (pod->window));
+    }
+
   gtk_window_set_urgency_hint (GTK_WINDOW (pod->window), TRUE);
 }