compositor: add WESTON_COMPOSITOR_OFFSCREEN state
This state is used when the user switches the vt. It turns of rendering
and frame events, but doesn't set the DPMS state to off.
As a part of this change, also turn off the idle timer when entering
the SLEEPING or OFFSCREEN states, which fixes
https://bugs.freedesktop.org/show_bug.cgi?id=61910 (rpi backend
untested).
diff --git a/src/compositor.h b/src/compositor.h
index 0ad60ef..7d1d68e 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -262,7 +262,9 @@
enum {
WESTON_COMPOSITOR_ACTIVE,
WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
- WESTON_COMPOSITOR_SLEEPING /* no rendering, no frame events */
+ WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
+ WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dmps
+ * to off */
};
struct weston_layer {
@@ -621,6 +623,8 @@
void
weston_compositor_wake(struct weston_compositor *compositor);
void
+weston_compositor_offscreen(struct weston_compositor *compositor);
+void
weston_compositor_sleep(struct weston_compositor *compositor);
void
weston_compositor_update_drag_surfaces(struct weston_compositor *compositor);