From 802f7dcd307cad41f49a397d1a284fb2bad2e3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 24 Jul 2017 17:16:38 +0800 Subject: [PATCH] monitor: Add meta_monitor_get_gpu() Add API to get what GPU drives this monitor. https://bugzilla.gnome.org/show_bug.cgi?id=785381 --- src/backends/meta-monitor.c | 8 ++++++++ src/backends/meta-monitor.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index ee850446c..50a545ba1 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -180,6 +180,14 @@ meta_monitor_generate_spec (MetaMonitor *monitor) priv->spec = monitor_spec; } +MetaGpu * +meta_monitor_get_gpu (MetaMonitor *monitor) +{ + MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor); + + return priv->gpu; +} + GList * meta_monitor_get_outputs (MetaMonitor *monitor) { diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index 0026bb0e6..e11dfc2fc 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -101,6 +101,8 @@ MetaMonitorNormal * meta_monitor_normal_new (MetaGpu *gpu, MetaMonitorSpec * meta_monitor_get_spec (MetaMonitor *monitor); +MetaGpu * meta_monitor_get_gpu (MetaMonitor *monitor); + gboolean meta_monitor_is_active (MetaMonitor *monitor); MetaOutput * meta_monitor_get_main_output (MetaMonitor *monitor);