[mutter/benzea/ignore-monitor-connector: 1248/1253] monitor: Make the connector the last sort key for monitors
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/benzea/ignore-monitor-connector: 1248/1253] monitor: Make the connector the last sort key for monitors
- Date: Fri, 23 Oct 2020 15:16:36 +0000 (UTC)
commit 193da8de1931bc7742b52f45eb687771908fe910
Author: Benjamin Berg <bberg redhat com>
Date: Fri Dec 20 13:47:31 2019 +0100
monitor: Make the connector the last sort key for monitors
We want to ignore the connector in certain situations. Prepare this by
changing the sort order so that two monitors will be paired up in the
list if only the connector is different.
https://gitlab.gnome.org/GNOME/mutter/issues/932
src/backends/meta-monitor.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index ae7816a3bd..ae2b8ea04b 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -143,19 +143,23 @@ meta_monitor_spec_compare (MetaMonitorSpec *monitor_spec_a,
{
int ret;
- ret = strcmp (monitor_spec_a->connector, monitor_spec_b->connector);
+ ret = strcmp (monitor_spec_a->vendor, monitor_spec_b->vendor);
if (ret != 0)
return ret;
- ret = strcmp (monitor_spec_a->vendor, monitor_spec_b->vendor);
+ ret = strcmp (monitor_spec_a->product, monitor_spec_b->product);
if (ret != 0)
return ret;
- ret = strcmp (monitor_spec_a->product, monitor_spec_b->product);
+ ret = strcmp (monitor_spec_a->serial, monitor_spec_b->serial);
+ if (ret != 0)
+ return ret;
+
+ ret = strcmp (monitor_spec_a->connector, monitor_spec_b->connector);
if (ret != 0)
return ret;
- return strcmp (monitor_spec_a->serial, monitor_spec_b->serial);
+ return 0;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]