Commit 68457117 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Expose screen locked state in policy agent

The logic is already all there so might as well expose that so that
actions can check for screen being locked
parent 6c499ab4
......@@ -409,6 +409,11 @@ PolicyAgent::RequiredPolicies PolicyAgent::unavailablePolicies()
return retpolicies;
}
bool PolicyAgent::screenLockerActive() const
{
return m_screenLockerActive;
}
PolicyAgent::RequiredPolicies PolicyAgent::requirePolicyCheck(PolicyAgent::RequiredPolicies policies)
{
if (!m_sdAvailable) {
......@@ -496,7 +501,10 @@ void PolicyAgent::onScreenLockerActiveChanged(bool active)
{
const auto oldPolicies = unavailablePolicies();
m_screenLockerActive = active;
if (m_screenLockerActive != active) {
m_screenLockerActive = active;
Q_EMIT screenLockerActiveChanged(active);
}
const auto newPolicies = unavailablePolicies();
......
......@@ -79,6 +79,8 @@ public:
RequiredPolicies unavailablePolicies();
bool screenLockerActive() const;
void setupSystemdInhibition();
public Q_SLOTS:
......@@ -96,6 +98,7 @@ Q_SIGNALS:
void unavailablePoliciesChanged(PowerDevil::PolicyAgent::RequiredPolicies newpolicies);
void sessionActiveChanged(bool active);
void screenLockerActiveChanged(bool active);
private Q_SLOTS:
void onServiceUnregistered(const QString & serviceName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment