#775125 boinc-client: boinc does not detect mouse activity for the pourpose of suspending computation #775125
- Package:
- boinc-client
- Source:
- boinc
- Description:
- core client for the BOINC distributed computing infrastructure
- Submitter:
- Alessandro Barbieri
- Date:
- 2023-06-16 12:42:03 UTC
- Severity:
- normal
Dear Maintainer, * What led up to the situation? Moving mouse does not break computation when in options is told to not compute when computer is in use. Keyboard pressing instead works. * What outcome did you expect instead? Treat mouse movement as same as key pressing regarding computer activity/inactivity.
Currently it doesn't seem that there's any reliable way of detecting keyboard/ mouse input in Wayland, some implementations apparently don't support it. Allowing such access in any X or Wayland server at the moment requires more access to the server than is good for security. If there was a way to grant access to ask the server "are you doing stuff" and not any other access then that would be good, but doesn't seem to be possible. With systemd the command "loginctl show-session $ID" will show information about the session in question including the line "LockedHint=no" (screen unlocked) or "LockedHint=yes" (screen locked). For BOINC's purposes checking whether the screen is locked seems sufficient and it can be done with less invasive access to the system. Another possibility is to check the idle time as reported by "w" and similar commands. That works for ssh sessions and would probably be a good alternative option depending on how the system is used.
The package swayidle has code to detect idle time, the source has little in the way of comments and is difficult to understand. swayidle -w timeout 5 'echo 5' timeout 10 'echo 10' resume 'echo resume' \ before-sleep 'echo before-sleep' A command-line like the above will display messages on 5 seconds and 10 seconds of idle time and display "resume" when there is keyboard or mouse input. That could be changed to have kill -USR1 and kill -USR2 and use them as the signals for the system being idle or in-use. If BOINC took those signals then the local user/sysadmin could script things to work with X11, terminal logins, etc. The current code only works with X11 and even that code has issues. If signals aren't considered a good way of doing it then there could be a flag file or some other method. As an aside to run swayidle as root you need to set this environment variable WAYLAND_DISPLAY=../$REALUID/wayland-0 where REALUID is the UID of the user with the graphical login.