Controlling display state
Problem
I recently started to switch our Operating System from X to wayland. Our OS is used sort of like a digital signage system, with chromium as it's only ui process. To prevent our display from running 24/7 we added a motion sensor, which wakes the display up when motion is detected. With X I used the command xset dpms force on
to turn the display on and off. With wayland/weston I haven't found a good solution to do the same thing.
Attempt
My first attempt after looking at the weston code was to copy the idle/sleep logic and use a "custom" wayland protocol to toggle the state of the screen, and to get notification if the screen would be woken up (via touch for example).
You can find my attempt here: soerenmeier/weston@9b606b0b.
Toggling the display state mostly works, but when the screen get's woken up via a touch interaction chromium crashes, but after chromium gets restarted it works again.
Solution
My question now is, what is the best way to wake a screen up or put it to sleep? The answer in #233 (closed) pointed at, adding a protocol extension in libweston. Is that still the best way to solve my problem?
If yes, would it be possible to get some help implementing this, since I'm pretty new to c/weston.