monitor-manager: Expose the privacy screen state on DBus current state
Expose each monitor state as two booleans, not to expose the whole flags Related-to: GNOME/gnome-control-center#909 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
This commit is contained in:
parent
f96a167aea
commit
fd1f6094c9
@ -336,6 +336,12 @@
|
|||||||
laptop panel (absence of this means it is
|
laptop panel (absence of this means it is
|
||||||
not built in)
|
not built in)
|
||||||
- "display-name" (s): a human readable display name of the monitor
|
- "display-name" (s): a human readable display name of the monitor
|
||||||
|
- "privacy-screen-state" (bb): the state of the privacy screen
|
||||||
|
(absence of this means it is not being
|
||||||
|
supported) first value indicates whether
|
||||||
|
it's enabled and second value whether it's
|
||||||
|
hardware locked (and so can't be changed
|
||||||
|
via gsettings)
|
||||||
|
|
||||||
Possible mode flags:
|
Possible mode flags:
|
||||||
1 : preferred mode
|
1 : preferred mode
|
||||||
|
@ -1802,6 +1802,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
|||||||
MetaMonitorSpec *monitor_spec = meta_monitor_get_spec (monitor);
|
MetaMonitorSpec *monitor_spec = meta_monitor_get_spec (monitor);
|
||||||
MetaMonitorMode *current_mode;
|
MetaMonitorMode *current_mode;
|
||||||
MetaMonitorMode *preferred_mode;
|
MetaMonitorMode *preferred_mode;
|
||||||
|
MetaPrivacyScreenState privacy_screen_state;
|
||||||
GVariantBuilder modes_builder;
|
GVariantBuilder modes_builder;
|
||||||
GVariantBuilder monitor_properties_builder;
|
GVariantBuilder monitor_properties_builder;
|
||||||
GList *k;
|
GList *k;
|
||||||
@ -1901,6 +1902,19 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
|||||||
"display-name",
|
"display-name",
|
||||||
g_variant_new_string (display_name));
|
g_variant_new_string (display_name));
|
||||||
|
|
||||||
|
privacy_screen_state = meta_monitor_get_privacy_screen_state (monitor);
|
||||||
|
if (privacy_screen_state != META_PRIVACY_SCREEN_UNAVAILABLE)
|
||||||
|
{
|
||||||
|
GVariant *state;
|
||||||
|
|
||||||
|
state = g_variant_new ("(bb)",
|
||||||
|
!!(privacy_screen_state & META_PRIVACY_SCREEN_ENABLED),
|
||||||
|
!!(privacy_screen_state & META_PRIVACY_SCREEN_LOCKED));
|
||||||
|
|
||||||
|
g_variant_builder_add (&monitor_properties_builder, "{sv}",
|
||||||
|
"privacy-screen-state", state);
|
||||||
|
}
|
||||||
|
|
||||||
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user