summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2021-03-21 22:30:06 +0100
committerMarge Bot <marge-bot@gnome.org>2021-09-20 15:37:59 +0000
commit49501c28f27bd8864839cad91b7f9e89c0c48103 (patch)
tree5214c2ac9374a323f1f37fe629e1c689a81ac1ec
parent9ce3abad28abae7150fdb6150d6ccd2a243db29f (diff)
downloadmutter-49501c28f27bd8864839cad91b7f9e89c0c48103.tar.gz
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>
-rw-r--r--src/backends/native/meta-kms-types.h1
-rw-r--r--src/backends/native/meta-kms.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/backends/native/meta-kms-types.h b/src/backends/native/meta-kms-types.h
index 64045ef45..5e9a4b3e7 100644
--- a/src/backends/native/meta-kms-types.h
+++ b/src/backends/native/meta-kms-types.h
@@ -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;
diff --git a/src/backends/native/meta-kms.c b/src/backends/native/meta-kms.c
index 6676db3e7..e66966f84 100644
--- a/src/backends/native/meta-kms.c
+++ b/src/backends/native/meta-kms.c
@@ -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);