[mutter] monitor-manager: Add helper for getting monitor from connector
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager: Add helper for getting monitor from connector
- Date: Tue, 29 Aug 2017 06:41:36 +0000 (UTC)
commit 3005a400ca7a85f3931444c1bbba360dc3059984
Author: Jonas Ådahl <jadahl gmail com>
Date: Wed Jun 21 13:44:06 2017 +0800
monitor-manager: Add helper for getting monitor from connector
This will be used later.
https://bugzilla.gnome.org/show_bug.cgi?id=784199
src/backends/meta-monitor-manager-private.h | 3 +++
src/backends/meta-monitor-manager.c | 18 ++++++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h
index 4d079be..563bf92 100644
--- a/src/backends/meta-monitor-manager-private.h
+++ b/src/backends/meta-monitor-manager-private.h
@@ -449,6 +449,9 @@ MetaMonitor * meta_monitor_manager_get_laptop_panel (MetaMonitorManager *m
MetaMonitor * meta_monitor_manager_get_monitor_from_spec (MetaMonitorManager *manager,
MetaMonitorSpec *monitor_spec);
+MetaMonitor * meta_monitor_manager_get_monitor_from_connector (MetaMonitorManager *manager,
+ const char *connector);
+
GList * meta_monitor_manager_get_monitors (MetaMonitorManager *manager);
MetaOutput *meta_monitor_manager_get_outputs (MetaMonitorManager *manager,
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 253b83a..1dd7c20 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -2314,6 +2314,24 @@ meta_monitor_manager_get_laptop_panel (MetaMonitorManager *manager)
}
MetaMonitor *
+meta_monitor_manager_get_monitor_from_connector (MetaMonitorManager *manager,
+ const char *connector)
+{
+ GList *l;
+
+ for (l = manager->monitors; l; l = l->next)
+ {
+ MetaMonitor *monitor = l->data;
+
+ if (g_str_equal (meta_monitor_get_connector (monitor),
+ connector))
+ return monitor;
+ }
+
+ return NULL;
+}
+
+MetaMonitor *
meta_monitor_manager_get_monitor_from_spec (MetaMonitorManager *manager,
MetaMonitorSpec *monitor_spec)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]