aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/benchmark.c')
-rw-r--r--modules/benchmark.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c
index af06dd27..aa88e7df 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -689,16 +689,21 @@ static void do_benchmark(void (*benchmark_function)(void), int entry)
gtk_widget_show(bench_image);
bench_dialog = gtk_message_dialog_new(
- GTK_WINDOW(shell_get_main_shell()->window), GTK_DIALOG_MODAL,
+ GTK_WINDOW(shell_get_main_shell()->transient_dialog), GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO, GTK_BUTTONS_NONE,
_("Benchmarking. Please do not move your mouse "
"or press any keys."));
- gtk_window_set_transient_for(GTK_WINDOW(bench_dialog),
- GTK_WINDOW(shell_get_main_shell()->transient_dialog));
- gtk_widget_set_sensitive(GTK_WIDGET(shell_get_main_shell()->transient_dialog),
- FALSE);
- gtk_dialog_add_buttons(GTK_DIALOG(bench_dialog), _("Cancel"),
- GTK_RESPONSE_ACCEPT, NULL);
+
+ gtk_widget_set_sensitive(
+ GTK_WIDGET(shell_get_main_shell()->transient_dialog), FALSE);
+
+ if (GTK_WINDOW(shell_get_main_shell()->transient_dialog) ==
+ GTK_WINDOW(shell_get_main_shell()->window)) {
+ gtk_dialog_add_buttons(GTK_DIALOG(bench_dialog), _("Cancel"),
+ GTK_RESPONSE_ACCEPT, NULL);
+ } else {
+ gtk_window_set_deletable(GTK_WINDOW(bench_dialog), FALSE);
+ }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(bench_dialog),
@@ -746,8 +751,8 @@ static void do_benchmark(void (*benchmark_function)(void), int entry)
g_io_channel_unref(channel);
shell_view_set_enabled(TRUE);
shell_status_set_enabled(TRUE);
- gtk_widget_set_sensitive(GTK_WIDGET(shell_get_main_shell()->transient_dialog),
- TRUE);
+ gtk_widget_set_sensitive(
+ GTK_WIDGET(shell_get_main_shell()->transient_dialog), TRUE);
g_free(benchmark_dialog);
shell_status_update(_("Done."));