From 0177ab45af26a00c3f520bdd16c970a6f87a3d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 17 Dec 2016 22:37:57 +0800 Subject: [PATCH] MetaMonitor: Add _is_laptop_panel() helper Add a helper to determine whether the monitor is the laptop panel or not. To be used by the configuration system. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/backends/meta-monitor.c | 18 ++++++++++++++++++ src/backends/meta-monitor.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 14b188047..33dc65518 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -164,6 +164,24 @@ meta_monitor_is_primary (MetaMonitor *monitor) return output->is_primary; } +gboolean +meta_monitor_is_laptop_panel (MetaMonitor *monitor) +{ + MetaOutput *output; + + output = meta_monitor_get_main_output (monitor); + + switch (output->connector_type) + { + case META_CONNECTOR_TYPE_eDP: + case META_CONNECTOR_TYPE_LVDS: + case META_CONNECTOR_TYPE_DSI: + return TRUE; + default: + return FALSE; + } +} + void meta_monitor_get_dimensions (MetaMonitor *monitor, int *width, diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index 72775e0fc..bb4858926 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -92,6 +92,8 @@ MetaOutput * meta_monitor_get_main_output (MetaMonitor *monitor); gboolean meta_monitor_is_primary (MetaMonitor *monitor); +gboolean meta_monitor_is_laptop_panel (MetaMonitor *monitor); + GList * meta_monitor_get_outputs (MetaMonitor *monitor); void meta_monitor_get_dimensions (MetaMonitor *monitor,