app: reimplement gimp_widget_flush_expose().

gimp_widget_flush_expose() has been removed since commit 3089a20167.
I now reimplemented it by simply checking if event sources are waiting
to be processed.
This was heavily needed as the statusbar was not showing any progress
(at least on highly demanding process, such as saving or loading files),
and therefore we were stuck with a seamingly frozen GUI.

Despite the name, this does not apply to a widget in particular anymore,
but to the whole program events.
This commit is contained in:
Jehan 2019-02-19 15:31:50 +01:00
parent 5719f9ac23
commit 7f05ec00cd
3 changed files with 13 additions and 16 deletions

View file

@ -441,10 +441,7 @@ gimp_statusbar_progress_start (GimpProgress *progress,
statusbar->progress_shown = TRUE;
}
#if 0
/* FIXME flush_expose */
gimp_widget_flush_expose (bar);
#endif
gimp_widget_flush_expose ();
gimp_statusbar_override_window_title (statusbar);
@ -503,10 +500,7 @@ gimp_statusbar_progress_set_text (GimpProgress *progress,
{
gimp_statusbar_replace (statusbar, "progress", NULL, "%s", message);
#if 0
/* FIXME flush_expose */
gimp_widget_flush_expose (bar);
#endif
gimp_widget_flush_expose ();
gimp_statusbar_override_window_title (statusbar);
}
@ -544,10 +538,7 @@ gimp_statusbar_progress_set_value (GimpProgress *progress,
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar),
percentage);
#if 0
/* FIXME flush_expose */
gimp_widget_flush_expose (bar);
#endif
gimp_widget_flush_expose ();
}
}
}
@ -582,10 +573,7 @@ gimp_statusbar_progress_pulse (GimpProgress *progress)
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (bar));
#if 0
/* FIXME flush_expose */
gimp_widget_flush_expose (bar);
#endif
gimp_widget_flush_expose ();
}
}
}

View file

@ -1865,3 +1865,10 @@ gimp_color_profile_chooser_dialog_connect_path (GtkWidget *dialog,
G_CALLBACK (connect_path_response),
NULL);
}
void
gimp_widget_flush_expose (void)
{
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, FALSE);
}

View file

@ -126,5 +126,7 @@ void gimp_color_profile_chooser_dialog_connect_path
GObject *config,
const gchar *property_name);
void gimp_widget_flush_expose (void);
#endif /* __APP_GIMP_WIDGETS_UTILS_H__ */