monitor-manager: Notify privacy screen changes on hotkey press

When privacy screen is changed and this happens on explicit user request
(that is not a setting change) we should notify about this via an OSD.

To perform this, we keep track of the reason that lead to a privacy
screen change, and when we record it we try to notify the user about.

When the hardware has not an explicit hotkey signal but we record a
change we must still fallback to this case.

Fixes: #2105
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
This commit is contained in:
Marco Trevisan (Treviño)
2021-08-02 18:22:46 +02:00
committed by Marge Bot
parent 4e10324a80
commit 8cf3485ab0
6 changed files with 135 additions and 4 deletions

View File

@ -478,6 +478,18 @@ meta_settings_is_privacy_screen_enabled (MetaSettings *settings)
return settings->privacy_screen;
}
void
meta_settings_set_privacy_screen_enabled (MetaSettings *settings,
gboolean enabled)
{
if (settings->privacy_screen == enabled)
return;
settings->privacy_screen = enabled;
g_settings_set_boolean (settings->privacy_settings, "privacy-screen",
enabled);
}
MetaSettings *
meta_settings_new (MetaBackend *backend)
{