[mutter] monitor-config: Replace output name heuristics with connector_type
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-config: Replace output name heuristics with connector_type
- Date: Tue, 30 Dec 2014 00:49:33 +0000 (UTC)
commit c1db9d918169842ab15f9122ca63a35ef815472c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Dec 29 16:45:18 2014 -0800
monitor-config: Replace output name heuristics with connector_type
It's more difficult to replace the MetaOutputKey usage, so just
do this for now.
src/backends/meta-monitor-config.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-monitor-config.c b/src/backends/meta-monitor-config.c
index 0b19559..265985f 100644
--- a/src/backends/meta-monitor-config.c
+++ b/src/backends/meta-monitor-config.c
@@ -899,6 +899,20 @@ key_is_laptop (MetaOutputKey *key)
}
static gboolean
+output_is_laptop (MetaOutput *output)
+{
+ /* FIXME: extend with better heuristics */
+ switch (output->connector_type)
+ {
+ case META_CONNECTOR_TYPE_eDP:
+ case META_CONNECTOR_TYPE_LVDS:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static gboolean
laptop_display_is_on (MetaConfiguration *config)
{
unsigned int i;
@@ -1060,8 +1074,7 @@ find_primary_output (MetaOutput *outputs,
for (i = 0; i < n_outputs; i++)
{
- if (g_str_has_prefix (outputs[i].name, "LVDS") ||
- g_str_has_prefix (outputs[i].name, "eDP"))
+ if (output_is_laptop (output))
return &outputs[i];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]