frame/native: Remember whether the frame carried a kms update

So that information is available in e.g. after_update handlers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2823>
This commit is contained in:
Robert Mader 2023-02-23 16:55:31 +01:00 committed by Marge Bot
parent ff246a2dc8
commit 020d128d15
2 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,7 @@ struct _MetaFrameNative
ClutterFrame base;
MetaKmsUpdate *kms_update;
gboolean had_kms_update;
};
static void
@ -59,6 +60,7 @@ meta_frame_native_set_kms_update (MetaFrameNative *frame_native,
g_return_if_fail (!frame_native->kms_update);
frame_native->kms_update = kms_update;
frame_native->had_kms_update = TRUE;
}
MetaKmsUpdate *
@ -73,6 +75,7 @@ meta_frame_native_ensure_kms_update (MetaFrameNative *frame_native,
}
frame_native->kms_update = meta_kms_update_new (kms_device);
frame_native->had_kms_update = TRUE;
return frame_native->kms_update;
}
@ -87,3 +90,9 @@ meta_frame_native_has_kms_update (MetaFrameNative *frame_native)
{
return !!frame_native->kms_update;
}
gboolean
meta_frame_native_had_kms_update (MetaFrameNative *frame_native)
{
return frame_native->had_kms_update;
}

View File

@ -43,4 +43,7 @@ MetaKmsUpdate * meta_frame_native_steal_kms_update (MetaFrameNative *frame_nativ
META_EXPORT_TEST
gboolean meta_frame_native_has_kms_update (MetaFrameNative *frame_native);
META_EXPORT_TEST
gboolean meta_frame_native_had_kms_update (MetaFrameNative *frame_native);
#endif /* META_FRAME_NATIVE_H */