From 6c8b103a7b2133c2e9f9d0eb8e23de20dcbe5fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 23 Mar 2017 23:33:34 +0800 Subject: [PATCH] DisplayConfig: Add "is_builtin" monitor property Add a per-monitor property allowing the application to determine whether the monitor is builtin or not, e.g. a laptop panel. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/backends/meta-monitor-manager.c | 6 ++++++ src/org.gnome.Mutter.DisplayConfig.xml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 976ecbf54..85441f76e 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1417,6 +1417,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, GVariantBuilder modes_builder; GVariantBuilder monitor_properties_builder; GList *k; + gboolean is_builtin; current_mode = meta_monitor_get_current_mode (monitor); preferred_mode = meta_monitor_get_preferred_mode (monitor); @@ -1458,6 +1459,11 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, g_variant_new_boolean (is_underscanning)); } + is_builtin = meta_monitor_is_laptop_panel (monitor); + g_variant_builder_add (&monitor_properties_builder, "{sv}", + "is_builtin", + g_variant_new_boolean (is_builtin)); + g_variant_builder_add (&monitors_builder, MONITOR_FORMAT, monitor_spec->connector, monitor_spec->vendor, diff --git a/src/org.gnome.Mutter.DisplayConfig.xml b/src/org.gnome.Mutter.DisplayConfig.xml index 961ed0306..c916b36ea 100644 --- a/src/org.gnome.Mutter.DisplayConfig.xml +++ b/src/org.gnome.Mutter.DisplayConfig.xml @@ -331,6 +331,9 @@ - "max_screen_size" (ii): the maximum size a screen may have (absence of this means unlimited screen size) + - "is_builtin" (b): whether the monitor is built in, e.g. a + laptop panel (absence of this means it is + not built in) Possible mode flags: 1 : preferred mode