diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 2d9ec5051..54a228e83 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -127,6 +127,17 @@ meta_monitor_spec_clone (MetaMonitorSpec *monitor_spec) return new_monitor_spec; } +guint +meta_monitor_spec_hash (gconstpointer key) +{ + const MetaMonitorSpec *monitor_spec = key; + + return (g_str_hash (monitor_spec->connector) + + g_str_hash (monitor_spec->vendor) + + g_str_hash (monitor_spec->product) + + g_str_hash (monitor_spec->serial)); +} + gboolean meta_monitor_spec_equals (MetaMonitorSpec *monitor_spec, MetaMonitorSpec *other_monitor_spec) diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index c1b62806e..4b3a527e3 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -262,6 +262,8 @@ gboolean meta_monitor_mode_should_be_advertised (MetaMonitorMode *monitor_mode); META_EXPORT_TEST MetaMonitorSpec * meta_monitor_spec_clone (MetaMonitorSpec *monitor_id); +guint meta_monitor_spec_hash (gconstpointer key); + META_EXPORT_TEST gboolean meta_monitor_spec_equals (MetaMonitorSpec *monitor_id, MetaMonitorSpec *other_monitor_id);