From 71fa41248e16207cf995354decc9c870184a95ba Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 1 Jul 2020 13:20:48 -0700 Subject: [PATCH] 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. --- src/sysprof/sysprof-application.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sysprof/sysprof-application.c b/src/sysprof/sysprof-application.c index 421961ab..b19ed873 100644 --- a/src/sysprof/sysprof-application.c +++ b/src/sysprof/sysprof-application.c @@ -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); }