1
0
Fork 0

kms: Return a more specific change if there are no devices

In case we have no devices, after a KMS update (both because they've
all have been removed or because there were none), we may need to behave
differently compared to the case in which nothing changed, so add a more
specific KMS update change type

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1964>
This commit is contained in:
Marco Trevisan (Treviño) 2021-03-21 22:30:06 +01:00 committed by Marge Bot
parent 9ce3abad28
commit 49501c28f2
2 changed files with 4 additions and 0 deletions

View file

@ -68,6 +68,7 @@ typedef enum _MetaKmsUpdateChanges
{
META_KMS_UPDATE_CHANGE_NONE = 0,
META_KMS_UPDATE_CHANGE_GAMMA = 1 << 0,
META_KMS_UPDATE_CHANGE_NO_DEVICES = 1 << 1,
META_KMS_UPDATE_CHANGE_FULL = -1,
} MetaKmsUpdateChanges;

View file

@ -576,6 +576,9 @@ meta_kms_update_states_in_impl (MetaKms *kms)
meta_assert_in_kms_impl (kms);
if (!kms->devices)
return META_KMS_UPDATE_CHANGE_NO_DEVICES;
for (l = kms->devices; l; l = l->next)
{
MetaKmsDevice *kms_device = META_KMS_DEVICE (l->data);