Commit 9a3a685d authored by Kai Lüke's avatar Kai Lüke

Register inhibitor for benchmark thread

The system should not be suspended
during a benchmark or GNOME Disk
be killed with a logout.

Invoke the GtkApplication inhibitor
for the benchmarking thread.

https://bugzilla.gnome.org/show_bug.cgi?id=794485
parent 9ed66d4e
......@@ -1168,9 +1168,17 @@ benchmark_thread (gpointer user_data)
long page_size;
guint64 disk_size;
GVariantBuilder options_builder;
guint inhibit_cookie;
//g_print ("bm thread start\n");
inhibit_cookie = gtk_application_inhibit (GTK_APPLICATION (gdu_window_get_application (data->window)),
GTK_WINDOW (data->dialog),
GTK_APPLICATION_INHIBIT_SUSPEND |
GTK_APPLICATION_INHIBIT_LOGOUT,
/* Translators: Reason why suspend/logout is being inhibited */
C_("create-inhibit-message", "Benchmarking device"));
g_variant_builder_init (&options_builder, G_VARIANT_TYPE_VARDICT);
g_variant_builder_add (&options_builder, "{sv}", "writable", g_variant_new_boolean (data->bm_do_write));
......@@ -1440,6 +1448,9 @@ benchmark_thread (gpointer user_data)
data->bm_thread = NULL;
data->bm_state = BM_STATE_NONE;
if (inhibit_cookie > 0)
gtk_application_uninhibit (GTK_APPLICATION (gdu_window_get_application (data->window)), inhibit_cookie);
if (error != NULL)
{
G_LOCK (bm_lock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment