diff --git a/src/backends/meta-monitor-config.c b/src/backends/meta-monitor-config.c index a934613f4..238305db5 100644 --- a/src/backends/meta-monitor-config.c +++ b/src/backends/meta-monitor-config.c @@ -916,20 +916,6 @@ key_is_laptop (MetaOutputKey *key) g_str_has_prefix (key->connector, "eDP"); } -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) { @@ -1092,7 +1078,7 @@ find_primary_output (MetaOutput *outputs, for (i = 0; i < n_outputs; i++) { - if (output_is_laptop (&outputs[i])) + if (meta_output_is_laptop (&outputs[i])) return i; } diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h index 1b80299d1..7cda017d8 100644 --- a/src/backends/meta-monitor-manager-private.h +++ b/src/backends/meta-monitor-manager-private.h @@ -398,6 +398,7 @@ void meta_monitor_manager_confirm_configuration (MetaMonitorManag void meta_output_parse_edid (MetaOutput *output, GBytes *edid); +gboolean meta_output_is_laptop (MetaOutput *output); void meta_crtc_info_free (MetaCRTCInfo *info); void meta_output_info_free (MetaOutputInfo *info); diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 56a52bb52..4849e3f74 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -511,14 +511,8 @@ make_display_name (MetaMonitorManager *manager, g_autofree char *inches = NULL; g_autofree char *vendor_name = NULL; - switch (output->connector_type) - { - case META_CONNECTOR_TYPE_LVDS: - case META_CONNECTOR_TYPE_eDP: + if (meta_output_is_laptop (output)) return g_strdup (_("Built-in display")); - default: - break; - } if (output->width_mm > 0 && output->height_mm > 0) { @@ -1464,6 +1458,20 @@ meta_output_parse_edid (MetaOutput *meta_output, meta_output->serial = g_strdup ("unknown"); } +gboolean +meta_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; + } +} + void meta_monitor_manager_on_hotplug (MetaMonitorManager *manager) {