Updated to include review feedback from Quentin on the v5. That involves refinements to the destructor behavior, reorganizing patches a bit, and noting that if the idle manager is destroyed by the client, the individual inhibitor objects remain active. The libweston-desktop API is renamed from surface_drop_idle_inhibitor to just drop_idle_inhibitor.
Manual testing: =============== 0. Default idling a. Start compositor with `weston` b. Leave system with no input until the idle time configured in weston.ini (default 300 seconds) c. Screen should fade to black d. Generate some input events (e.g. move mouse cursor). Display should fade back in, showing an unlock-screen client. e. Unlock the screen. Should display an empty desktop. 1. Configured idle time with no clients a. Start compositor with `weston -i3` b. After about 3 seconds the screen should begin fading to black c. Re-awaken display and unlock d. Repeat from b several times 2. Idle time with non-inhibiting client a. Start compositor with `weston -i3` b. Launch weston-terminal c. From weston-terminal run the following bash command `i=0; while :; do echo $i; i=$((i+100)); sleep 0.1; done` d. Screen should fade out between 3000 and 3500 msec. There should be no discontinuity in the time outputs (i.e. the output should not jump from say 3200 msec to 8000 msec, but rather the scrollback should be a continual list of numbers incrementing by 100 each line). 3. Idle inhibition a. Start compositor with `weston -i3` b. Launch weston-terminal c. From weston-terminal launch the idle inhibition demo client `weston-simple-idle` d. Allow the client to run for more than 3 seconds without touching keyboard, mouse, or other input activity. While it is running the screen it is displayed on should not fade out. e. From weston-terminal kill weston-simple-idle with ctrl-C f. Wait another 3 seconds with no input activity. The screen should fade to black. g. Repeat from (c) a few times. 4. Verbose idle inhibition a. Start compositor with `weston -i3` b. Launch weston-terminal c. From weston-terminal run `weston-simple-idle -V` d. Output should continue printing indefinitely (past 3000 msec), and the screen should not fade out. e. Terminate the weston-simple-idle process from weston-terminal (i.e. via ctrl-C); screen should then fade out after 3 seconds. 5. Delayed idle inhibition a. Start compositor with `weston -i3` b. Launch weston-terminal c. From weston-terminal run `weston-simple-idle -V -c1000` d. Output should indicate client requests an inhibitor after 1000 msec. e. Screen should not fade out until after the weston-simple-idle process is terminated. 6. Inhibition request made after display is already idled off a. Start compositor with `weston -i3` b. Launch weston-terminal c. From weston-terminal run `weston-simple-idle -V -c4500` d. Screen should fade out after 3 seconds of no input activity e. Wake screen and unlock after several seconds f. Output should show a discontinuity in output (i.e. a jump from say, 4321 to 8765 msec.) It should also indicate it has requested an inhibitor subsequent to the screen fading to black. g. Allow the client to run >3 additional seconds. Output should continue printing and the screen should not fade out until after the client is exited. 7. Inhibition request made while compositor is in the middle of fading out a. Start compositor with `weston -i3` b. Launch weston-terminal c. From weston-terminal run `weston-simple-idle -V -c2800` d. Allow it to run > 3 sec. Screen should not fade out. e. From weston-terminal run `weston-simple-idle -V -c3000` f. Output should display 'Requesting inhibitor' just as the screen is fading out. Screen should fade to black. 8. Inhibition termination while compositor is otherwise sleeping a. Start compositor with `weston -i10` b. Outside weston, run `weston-simple-idle -V -d12000` c. Output should print past 10000 msec and screen should not fade out. d. After 12000 msec, output should indicate the inhibitor was destroyed. Screen should fade to black immediately (i.e. within less than a second). Bryce Harrington (6): desktop-shell: Enable per-output fade animations compositor: Add internal support to track idle inhibition requests compositor: Add public interface support for client-requested idle inhibition libweston-desktop: Add listener and API to drop the idle inhibitor shell: Inhibit idle fade-out behavior clients: Add screensaver inhibitor client demo .gitignore | 1 + Makefile.am | 18 +- clients/simple-idle.c | 573 ++++++++++++++++++++++++++++++++++ desktop-shell/shell.c | 172 ++++++---- desktop-shell/shell.h | 14 +- libweston-desktop/internal.h | 3 + libweston-desktop/libweston-desktop.c | 9 + libweston-desktop/libweston-desktop.h | 2 + libweston-desktop/surface.c | 17 + libweston/compositor.c | 164 +++++++++- libweston/compositor.h | 15 +- 11 files changed, 909 insertions(+), 79 deletions(-) create mode 100644 clients/simple-idle.c -- 1.9.1 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel