Commit 176cb24b authored by Joaquim Rocha's avatar Joaquim Rocha Committed by Kalev Lember

Notify apps' property changes from the main loop

These changes avoid a race when apps are refined from within a
different thread, as their properties' notification were being
emitted (and thus triggering) code from those.

Specifically there was a race when setting up the CSS for the
background tile as this code was not getting run from the main
loop.
parent cd114c93
......@@ -955,6 +955,15 @@ gs_plugin_loader_run_refine_internal (GsPluginLoaderHelper *helper,
return TRUE;
}
static gboolean
app_thaw_notify_idle (gpointer data)
{
GsApp *app = GS_APP (data);
g_object_thaw_notify (G_OBJECT (app));
g_object_unref (app);
return G_SOURCE_REMOVE;
}
static gboolean
gs_plugin_loader_run_refine (GsPluginLoaderHelper *helper,
GsAppList *list,
......@@ -1039,7 +1048,7 @@ out:
/* now emit all the changed signals */
for (guint i = 0; i < gs_app_list_length (freeze_list); i++) {
GsApp *app = gs_app_list_index (freeze_list, i);
g_object_thaw_notify (G_OBJECT (app));
g_idle_add (app_thaw_notify_idle, g_object_ref (app));
}
return ret;
}
......
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