app: present window before opening captures

This is necessary to ensure that message dialogs that are shown when a
capture fails to open can be displayed above the window.
This commit is contained in:
Christian Hergert
2020-07-01 13:20:48 -07:00
parent fc474fb54b
commit 71fa41248e

View File

@ -94,11 +94,14 @@ sysprof_application_open (GApplication *app,
window = sysprof_window_new (SYSPROF_APPLICATION (app));
/* Present window before opening files so that message dialogs
* always display above the window.
*/
gtk_window_present (GTK_WINDOW (window));
for (gint i = 0; i < n_files; i++)
sysprof_window_open (SYSPROF_WINDOW (window), files[i]);
gtk_window_present (GTK_WINDOW (window));
if (n_files == 0)
sysprof_application_activate (app);
}