From 04d7fcf60dadcccdc03f895e73f9f6410cc044d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 6 Apr 2017 13:13:20 +0800 Subject: [PATCH] DisplayConfig: Add display-name monitor property This is the same property as the one associated with an output in GetResources. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/backends/meta-monitor-manager.c | 8 ++++++++ src/org.gnome.Mutter.DisplayConfig.xml | 1 + 2 files changed, 9 insertions(+) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index faaa3ee2b..3404be8f8 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1419,6 +1419,8 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, GVariantBuilder monitor_properties_builder; GList *k; gboolean is_builtin; + MetaOutput *main_output; + char *display_name; current_mode = meta_monitor_get_current_mode (monitor); preferred_mode = meta_monitor_get_preferred_mode (monitor); @@ -1465,6 +1467,12 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, "is-builtin", g_variant_new_boolean (is_builtin)); + main_output = meta_monitor_get_main_output (monitor); + display_name = make_display_name (manager, main_output); + g_variant_builder_add (&monitor_properties_builder, "{sv}", + "display-name", + g_variant_new_take_string (display_name)); + 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 d788577af..5b544381f 100644 --- a/src/org.gnome.Mutter.DisplayConfig.xml +++ b/src/org.gnome.Mutter.DisplayConfig.xml @@ -334,6 +334,7 @@ - "is-builtin" (b): whether the monitor is built in, e.g. a laptop panel (absence of this means it is not built in) + - "display-name" (s): a human readable display name of the monitor Possible mode flags: 1 : preferred mode