Skip to content

Inhibit: Forward the correct inhibition flags to PolicyAgent

Jakob Petsovits requested to merge work/jpetso/flatpak-inhibit-idle into master

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

Edited by Jakob Petsovits

Merge request reports