diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c index 4e762b64a1e0484db5394988113f8029a76c3b96..933354ecc84f2de23018e2279d19f0ea49266cfc 100644 --- a/thunar/thunar-application.c +++ b/thunar/thunar-application.c @@ -821,6 +821,7 @@ thunar_application_launch (ThunarApplication *application, GdkScreen *screen; ThunarJob *job; GList *parent_folder_list = NULL; + gboolean has_jobs; _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent)); @@ -851,21 +852,19 @@ thunar_application_launch (ThunarApplication *application, if (screen != NULL) gtk_window_set_screen (GTK_WINDOW (dialog), screen); - if (thunar_progress_dialog_has_jobs (THUNAR_PROGRESS_DIALOG (dialog))) - { - /* add the job to the dialog */ - thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), - job, icon_name, title); + has_jobs = thunar_progress_dialog_has_jobs (THUNAR_PROGRESS_DIALOG (dialog)); + + /* add the job to the dialog */ + thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), + job, icon_name, title); + if (has_jobs) + { /* show the dialog immediately */ thunar_application_show_dialogs (application); } else { - /* add the job to the dialog */ - thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), - job, icon_name, title); - /* Set up a timer to show the dialog, to make sure we don't * just popup and destroy a dialog for a very short job. */