1
0
Fork 0

kms: Keep a shutting_down flag

(cherry picked from commit 340366ac4a894306a0e48fd28bda35fb9e9319c7)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2022-04-20 18:33:43 +08:00 committed by Mingi Sung
parent e0d5a91286
commit 99f7286461
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5
2 changed files with 11 additions and 0 deletions

View file

@ -66,6 +66,8 @@ struct _MetaKms
int kernel_thread_inhibit_count;
MetaKmsCursorManager *cursor_manager;
gboolean shutting_down;
};
G_DEFINE_TYPE (MetaKms, meta_kms, META_TYPE_THREAD)
@ -352,6 +354,12 @@ meta_kms_create_device (MetaKms *kms,
return device;
}
gboolean
meta_kms_is_shutting_down (MetaKms *kms)
{
return kms->shutting_down;
}
static gpointer
prepare_shutdown_in_impl (MetaThreadImpl *thread_impl,
gpointer user_data,
@ -367,6 +375,7 @@ static void
on_prepare_shutdown (MetaBackend *backend,
MetaKms *kms)
{
kms->shutting_down = TRUE;
meta_kms_run_impl_task_sync (kms, prepare_shutdown_in_impl, NULL, NULL);
meta_thread_flush_callbacks (META_THREAD (kms));

View file

@ -61,6 +61,8 @@ MetaKmsDevice * meta_kms_create_device (MetaKms *kms,
MetaKmsDeviceFlag flags,
GError **error);
gboolean meta_kms_is_shutting_down (MetaKms *kms);
MetaKms * meta_kms_new (MetaBackend *backend,
MetaKmsFlags flags,
GError **error);