diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-12-29 16:45:18 -0800 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-12-29 16:46:06 -0800 |
commit | c1db9d918169842ab15f9122ca63a35ef815472c (patch) | |
tree | 9ec0068394b2986eb613fb9806cb940acbc56e6a /src/backends/meta-monitor-config.c | |
parent | 9d2cd8ff877b0f8828841d41cc12aa8ce0919084 (diff) |
monitor-config: Replace output name heuristics with connector_type
It's more difficult to replace the MetaOutputKey usage, so just
do this for now.
Diffstat (limited to 'src/backends/meta-monitor-config.c')
-rw-r--r-- | 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 0b195591..265985f0 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]; } |