Skip to content

馃崚 Inhibit: Forward the correct inhibition flags to PolicyAgent

Jakob Petsovits requested to merge work/cherry-pick-1549c49f into Plasma/6.1

Cherry-pick MR for !305 (merged).


The Inhibit method ignored the value of the "flags" argument and always sent InterruptSession as inhibition policy. This prevents sleep, but does not prevent idle actions such as screen locking and dimming.

This commit changes the requested inhibition policies to match the documented values for "flags":

  • Portals "Suspend" remains PolicyAgent "InterruptSession".
  • Portals "Idle" becomes PolicyAgent "ChangeScreenSettings".
  • Portals "Logout" and "User Switch" are not supported at this time and are merely logged but otherwise ignored.

PowerDevil, which implements the PolicyAgent API, uses the same policies also to represent the logind "sleep" and "idle" inhibitors, so we can trust that they behave accordingly.

BUG: 486506 CCBUG: 472541 CCBUG: 335729

(cherry picked from commit 1549c49f)

Co-authored-by: Jakob Petsovits jpetso@petsovits.com

Merge request reports