Skip to content

screenShield: Don't unnecessarily close and recreate inhibitors

ScreenShield::_syncInhibitor() was closing (and recreating) the inhibitor everytime it was called, even if no change was needed. This gets called in various places, including on property changes in the login1 dbus object. If this gets triggered by the time logind already started suspending and is only waiting for inhibitors and all other inhibitors have been closed, closing this inhibitor will cause suspending to proceed. Then by the time the new inhibitor is created it is no longer possible to inhibit, resulting in an error message and the system suspending. Due to the missing inhibitor suspend can also happen before the lock screen is shown, which will then complete after resume.

Fixes #3736 (closed)

Merge request reports