> The problem is determining how to constrain it to go idle, where "idle"
From your literal description:
setpriority. signal, process groups.
kill(-desktopgroup, SIGSTOP);
kill(-desktopgroup, SIGCONT);
kill(pid_i_am_crit_eventing, SIGCONT);
or SIGTSTP might be friendlier as a well behaved smart app can catch it,
fire it into the event loop and elegantly save and sleep.
Some window managers played with doing setpriority for focussed windows.
OLPC the same thing for OOM targets via /proc/oom_adj
The scheduler can happily do this, the power management will also
recognize STOPPED processes as no impediment to suspend.
--