Async variant to check whether power management is inhibited

Authored by graesslin on Jan 29 2016, 2:12 PM.

Description

Async variant to check whether power management is inhibited

Summary:
KScreenLocker checks whether power management is inhibited on idle
time out. So far this used a sync and blocking dbus call.

This change makes the check async. KScreenLocker connects to the
InhibitionsChanged signal provided by powerdevil and queries the
current state in an async way each time the signal gets emitted.

When KScreenLocker hits an idle connection it has the knowledge wheter
power management is inhibited and does not need to perform the blocking
call any more.

It's important for KScreenLocker to not have blocking calls as it's
used inside the Wayland compositor and can by that easily create
dead-lock situations (e.g. PowerDevil waiting for the Wayland compositor
and the compositor waiting for the reply).

Reviewers: bshah, broulik

Subscribers: plasma-devel

Projects: Plasma

Differential Revision: https://phabricator.kde.org/D884

Details

Committed
graesslinFeb 1 2016, 3:30 PM
Differential Revision
D884: Async variant to check whether power management is inhibited
Parents
R133:dc984381ee13: Port to CMake automoc
Branches
Unknown
Tags
Unknown