DisplayConfig: Advertise monitor color standard support
It'll be used to allow Settings to know whether it can enable HDR or not. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
This commit is contained in:
@ -2002,6 +2002,23 @@ request_persistent_confirmation (MetaMonitorManager *manager)
|
||||
#define LOGICAL_MONITOR_FORMAT "(iidub" LOGICAL_MONITOR_MONITORS_FORMAT "a{sv})"
|
||||
#define LOGICAL_MONITORS_FORMAT "a" LOGICAL_MONITOR_FORMAT
|
||||
|
||||
static GVariant *
|
||||
generate_color_modes_variant (MetaMonitor *monitor)
|
||||
{
|
||||
GVariantBuilder builder;
|
||||
GList *l;
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("au"));
|
||||
for (l = meta_monitor_get_supported_color_modes (monitor); l; l = l->next)
|
||||
{
|
||||
MetaColorMode color_mode = GPOINTER_TO_INT (l->data);
|
||||
|
||||
g_variant_builder_add (&builder, "u", color_mode);
|
||||
}
|
||||
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
||||
GDBusMethodInvocation *invocation,
|
||||
@ -2159,6 +2176,10 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
||||
"is-for-lease",
|
||||
g_variant_new_boolean (is_for_lease));
|
||||
|
||||
g_variant_builder_add (&monitor_properties_builder, "{sv}",
|
||||
"supported-color-modes",
|
||||
generate_color_modes_variant (monitor));
|
||||
|
||||
g_variant_builder_add (&monitors_builder, MONITOR_FORMAT,
|
||||
monitor_spec->connector,
|
||||
monitor_spec->vendor,
|
||||
|
@ -12,10 +12,11 @@ Monitors:
|
||||
│ │ └──Properties: (2)
|
||||
│ │ ├──is-current ⇒ yes
|
||||
│ │ └──is-preferred ⇒ yes
|
||||
│ └──Properties: (3)
|
||||
│ └──Properties: (4)
|
||||
│ ├──is-builtin ⇒ no
|
||||
│ ├──display-name ⇒ MetaProduct's Inc. 14"
|
||||
│ └──is-for-lease ⇒ no
|
||||
│ ├──is-for-lease ⇒ no
|
||||
│ └──supported-color-modes ⇒ [0]
|
||||
└──Monitor DP-2 (MetaProduct's Inc. 13")
|
||||
├──Vendor: MetaProduct's Inc.
|
||||
├──Product: MetaMonitor
|
||||
@ -29,10 +30,11 @@ Monitors:
|
||||
│ └──Properties: (2)
|
||||
│ ├──is-current ⇒ yes
|
||||
│ └──is-preferred ⇒ yes
|
||||
└──Properties: (3)
|
||||
└──Properties: (4)
|
||||
├──is-builtin ⇒ no
|
||||
├──display-name ⇒ MetaProduct's Inc. 13"
|
||||
└──is-for-lease ⇒ no
|
||||
├──is-for-lease ⇒ no
|
||||
└──supported-color-modes ⇒ [0]
|
||||
|
||||
Logical monitors:
|
||||
├──Logical monitor #1
|
||||
|
@ -30,10 +30,11 @@ Monitors:
|
||||
│ │ ├──Preferred scale: 1.0
|
||||
│ │ ├──Supported scales: [1.0, 1.25, 1.5, 1.7475727796554565]
|
||||
│ │ └──Properties: (0)
|
||||
│ └──Properties: (3)
|
||||
│ └──Properties: (4)
|
||||
│ ├──is-builtin ⇒ no
|
||||
│ ├──display-name ⇒ MetaProduct's Inc. 14"
|
||||
│ └──is-for-lease ⇒ no
|
||||
│ ├──is-for-lease ⇒ no
|
||||
│ └──supported-color-modes ⇒ [0]
|
||||
└──Monitor DP-2 (MetaProduct's Inc. 13")
|
||||
├──Vendor: MetaProduct's Inc.
|
||||
├──Product: MetaMonitor
|
||||
@ -65,10 +66,11 @@ Monitors:
|
||||
│ ├──Preferred scale: 1.0
|
||||
│ ├──Supported scales: [1.0]
|
||||
│ └──Properties: (0)
|
||||
└──Properties: (3)
|
||||
└──Properties: (4)
|
||||
├──is-builtin ⇒ no
|
||||
├──display-name ⇒ MetaProduct's Inc. 13"
|
||||
└──is-for-lease ⇒ no
|
||||
├──is-for-lease ⇒ no
|
||||
└──supported-color-modes ⇒ [0]
|
||||
|
||||
Logical monitors:
|
||||
├──Logical monitor #1
|
||||
|
Reference in New Issue
Block a user