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:
parent
f1e497acfa
commit
a39e941f91
@ -393,11 +393,16 @@
|
|||||||
Variable Refresh Rate is active (absence
|
Variable Refresh Rate is active (absence
|
||||||
of this means unknown)
|
of this means unknown)
|
||||||
- "is-for-lease" (b): whether the monitor is for lease or not
|
- "is-for-lease" (b): whether the monitor is for lease or not
|
||||||
|
- "supported-color-modes" (au): list of supported color modes
|
||||||
|
|
||||||
Possible mode flags:
|
Possible mode flags:
|
||||||
1 : preferred mode
|
1 : preferred mode
|
||||||
2 : current mode
|
2 : current mode
|
||||||
|
|
||||||
|
Available color modes:
|
||||||
|
0 : default
|
||||||
|
1 : BT.2100
|
||||||
|
|
||||||
|
|
||||||
@logical_monitors represent current logical monitor configuration
|
@logical_monitors represent current logical monitor configuration
|
||||||
|
|
||||||
|
@ -2002,6 +2002,23 @@ request_persistent_confirmation (MetaMonitorManager *manager)
|
|||||||
#define LOGICAL_MONITOR_FORMAT "(iidub" LOGICAL_MONITOR_MONITORS_FORMAT "a{sv})"
|
#define LOGICAL_MONITOR_FORMAT "(iidub" LOGICAL_MONITOR_MONITORS_FORMAT "a{sv})"
|
||||||
#define LOGICAL_MONITORS_FORMAT "a" LOGICAL_MONITOR_FORMAT
|
#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
|
static gboolean
|
||||||
meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
||||||
GDBusMethodInvocation *invocation,
|
GDBusMethodInvocation *invocation,
|
||||||
@ -2159,6 +2176,10 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
|||||||
"is-for-lease",
|
"is-for-lease",
|
||||||
g_variant_new_boolean (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,
|
g_variant_builder_add (&monitors_builder, MONITOR_FORMAT,
|
||||||
monitor_spec->connector,
|
monitor_spec->connector,
|
||||||
monitor_spec->vendor,
|
monitor_spec->vendor,
|
||||||
|
@ -12,10 +12,11 @@ Monitors:
|
|||||||
│ │ └──Properties: (2)
|
│ │ └──Properties: (2)
|
||||||
│ │ ├──is-current ⇒ yes
|
│ │ ├──is-current ⇒ yes
|
||||||
│ │ └──is-preferred ⇒ yes
|
│ │ └──is-preferred ⇒ yes
|
||||||
│ └──Properties: (3)
|
│ └──Properties: (4)
|
||||||
│ ├──is-builtin ⇒ no
|
│ ├──is-builtin ⇒ no
|
||||||
│ ├──display-name ⇒ MetaProduct's Inc. 14"
|
│ ├──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")
|
└──Monitor DP-2 (MetaProduct's Inc. 13")
|
||||||
├──Vendor: MetaProduct's Inc.
|
├──Vendor: MetaProduct's Inc.
|
||||||
├──Product: MetaMonitor
|
├──Product: MetaMonitor
|
||||||
@ -29,10 +30,11 @@ Monitors:
|
|||||||
│ └──Properties: (2)
|
│ └──Properties: (2)
|
||||||
│ ├──is-current ⇒ yes
|
│ ├──is-current ⇒ yes
|
||||||
│ └──is-preferred ⇒ yes
|
│ └──is-preferred ⇒ yes
|
||||||
└──Properties: (3)
|
└──Properties: (4)
|
||||||
├──is-builtin ⇒ no
|
├──is-builtin ⇒ no
|
||||||
├──display-name ⇒ MetaProduct's Inc. 13"
|
├──display-name ⇒ MetaProduct's Inc. 13"
|
||||||
└──is-for-lease ⇒ no
|
├──is-for-lease ⇒ no
|
||||||
|
└──supported-color-modes ⇒ [0]
|
||||||
|
|
||||||
Logical monitors:
|
Logical monitors:
|
||||||
├──Logical monitor #1
|
├──Logical monitor #1
|
||||||
|
@ -30,10 +30,11 @@ Monitors:
|
|||||||
│ │ ├──Preferred scale: 1.0
|
│ │ ├──Preferred scale: 1.0
|
||||||
│ │ ├──Supported scales: [1.0, 1.25, 1.5, 1.7475727796554565]
|
│ │ ├──Supported scales: [1.0, 1.25, 1.5, 1.7475727796554565]
|
||||||
│ │ └──Properties: (0)
|
│ │ └──Properties: (0)
|
||||||
│ └──Properties: (3)
|
│ └──Properties: (4)
|
||||||
│ ├──is-builtin ⇒ no
|
│ ├──is-builtin ⇒ no
|
||||||
│ ├──display-name ⇒ MetaProduct's Inc. 14"
|
│ ├──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")
|
└──Monitor DP-2 (MetaProduct's Inc. 13")
|
||||||
├──Vendor: MetaProduct's Inc.
|
├──Vendor: MetaProduct's Inc.
|
||||||
├──Product: MetaMonitor
|
├──Product: MetaMonitor
|
||||||
@ -65,10 +66,11 @@ Monitors:
|
|||||||
│ ├──Preferred scale: 1.0
|
│ ├──Preferred scale: 1.0
|
||||||
│ ├──Supported scales: [1.0]
|
│ ├──Supported scales: [1.0]
|
||||||
│ └──Properties: (0)
|
│ └──Properties: (0)
|
||||||
└──Properties: (3)
|
└──Properties: (4)
|
||||||
├──is-builtin ⇒ no
|
├──is-builtin ⇒ no
|
||||||
├──display-name ⇒ MetaProduct's Inc. 13"
|
├──display-name ⇒ MetaProduct's Inc. 13"
|
||||||
└──is-for-lease ⇒ no
|
├──is-for-lease ⇒ no
|
||||||
|
└──supported-color-modes ⇒ [0]
|
||||||
|
|
||||||
Logical monitors:
|
Logical monitors:
|
||||||
├──Logical monitor #1
|
├──Logical monitor #1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user