[mutter] MetaMonitor: Add _is_laptop_panel() helper
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaMonitor: Add _is_laptop_panel() helper
- Date: Wed, 25 Jan 2017 08:35:50 +0000 (UTC)
commit 0177ab45af26a00c3f520bdd16c970a6f87a3d49
Author: Jonas Ådahl <jadahl gmail com>
Date: Sat Dec 17 22:37:57 2016 +0800
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(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index 14b1880..33dc655 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 72775e0..bb48589 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]