Skip to content

Amend ext-idle-notify-protocol to work properly with apps for mitigating RSI

James Ramsey requested to merge james.jehiel.ramsey/wayland-protocols:main into main

There's a problem with apps that use the ext-idle-notify protocol to encourage (or even force) taking breaks in order to prevent or mitigate repetitive stress injury (RSI). These programs are designed such that if the user is active for a certain amount of time, there will be some sort of pop-up or other "encouragement" to get a user to take a break from typing, using the mouse, or otherwise providing input. Furthermore, these apps are also often designed to allow a user to take "natural" breaks; i.e., if a user is idle for a certain amount of time, then that obviates the need to pop-up a reminder to take a break. However, idle inhibitors interfere with the monitoring of user activity, because the apps cannot tell the difference between a case where the user is actually actively providing input, and cases where, say, the user is passively watching a video or presentation via an application that uses an idle inhibitor to prevent the screen from blanking out. These problems have been discussed here: !29 (comment 560996); https://github.com/rcaelers/workrave/issues/565; https://github.com/AllanChain/sane-break/issues/22

Following a discussion in the comments of issue #229, this revised protocol introduces a new request, get_input_idle_notification that creates an idle notification object that ignores idle inhibitors.

(The original get_idle_notification request can still be used to create an idle notification object that respects the inhibitors.)

I've already created a proof-of-concept implementation in a draft MR for wlroots, wlroots/wlroots!4937, which implements the revised ext-idle-notify protocol, and in a draft PR of Workrave, https://github.com/rcaelers/workrave/pull/590, which uses that revised protocol. I've even compiled and run this implementation, and so far, it seems to work. If I run Workrave under a compositor linked to the forked wlroots implementation, it ignores the idle inhibit request made when mpv plays a video, as desired, while if I run it under a compositor linked to the current wlroots release, it falls back to the old, unwanted behavior.

Tagging the maintainer of the ext-idle-notify protocol here: @emersion

ACKs:

  • wlroots
  • []

[x] Reviewed

Implementations:

Edited by James Ramsey

Merge request reports

Loading