kms: Prepare shutdown on 'prepare-shutdown' signal

Doing it in dispose means the backend is actively tearing down itself,
meaning various components might or might not be there, depending on how
the tearing down is implemented. Make things a bit more robust by doing
any work that might rely on the backend being there before shutdown is
done in response to the 'prepare-shutdown' signal being emitted by the
backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2853>
This commit is contained in:
Jonas Ådahl
2022-06-04 21:39:10 +02:00
committed by Marge Bot
parent 5f34d1eae2
commit c6b454d00f
3 changed files with 27 additions and 21 deletions

View File

@ -113,9 +113,6 @@ meta_backend_native_dispose (GObject *object)
{
MetaBackendNative *native = META_BACKEND_NATIVE (object);
if (native->kms)
meta_kms_prepare_shutdown (native->kms);
G_OBJECT_CLASS (meta_backend_native_parent_class)->dispose (object);
g_clear_pointer (&native->startup_render_devices, g_hash_table_unref);