Skip to content

Having inhibits be considered "active"

Bastien Nocera requested to merge wip/idletime-inhibitors into master

A small explanation of the problems, not that some patches are independent of each other, so don't take the order into account too much:

  • Idle inhibitors, as exported by gnome-session, aren't taken into account by mutter, causing the release of an inhibitor to trigger idletime timeouts that were shorter than the inhibition. Eg. 20 minutes timeout to suspend, 30 minutes film, the system will suspend after the movie player releases the inhibitor
  • The problem is fixable for Wayland without the "Remove X11 idle-monitor backend" patch. The current XSync X11 implementation can't be fixed short of gruesome hacks, or teaching an Xorg extension to talk D-Bus. This first patch replaces the X11 implementation with the Wayland one, moving them into common code.
  • The second patch (should) fix the actual problem we're here to fix, in this common code. The patch can also be applied to just the Wayland backend. I've haven't been able to test it yet, but I'll be adding tests to gnome-settings-daemon shortly.
  • The third patch moves the "reset idletime when the lid is opened, or resuming from suspend" to common code, so it can be used in both the X11 and Wayland backends. If we choose not to commit this patch, we'll need to make changes to g-s-d because of the next patch.
  • The 4th patch adds a way to reset the idle time, to work-around the fact that XTest-generated events don't trigger idle time resets after the first patch. When using XSync, core events and XI2 events are handled and will reset the idletime. Mutter X11 only listens to XI2 events, so won't even see the XTest fake key presses. We replace those fake key presses with a call to the D-Bus interface in g-s-d's power test suite.

See https://bugzilla.gnome.org/show_bug.cgi?id=794563

Merge request reports