title: gtk_events_pending() returns FALSE with events still pending
body: <p>I'm working on an application that has a start and stop button. These buttons block the UI, and for various reasons, I can't spawn a thread.</p>
  
  <p>I've been showing a working screen when these buttons are pressed, using:</p>
  
  <pre><code>while (gtk_events_pending()) gtk_main_iteration();
  </code></pre>
  
  <p>which ensures that the working screen is loaded before the start/stop operations begin.</p>
  
  <p>I've recently upgraded to GTK+ 3.8.6, and it seems that <code>gtk_events_pending()</code> is now broken. Now, sometimes the window shows, but the image in the window isn't there. Sometimes the window doesn't even show.</p>
  
  <p>The function in question looks like:</p>
  
  <pre><code>gtk_widget_show(working_screen);
  while (gtk_events_pending()) gtk_main_iteration();
  
  long_running_blocking_function();
  </code></pre>
  
  <p>If I do something like:</p>
  
  <pre><code>int busy_wait = 0;
  gtk_widget_show(working_screen);
  while (gtk_events_pending() || busy_wait &lt; 5) 
  {
      gtk_main_iteration();
      if (!gtk_events_pending()) ++busy_wait;
  }
  
  long_running_blocking_function();
  </code></pre>
  
  <p>...it works fine. However, I know it's only a matter of time until the busy_wait needs to be longer so I'd like to find a better answer. Has anybody experienced this issue? Does anybody have any ideas about how I might work around it?</p>