drm: Cancel any scheduled repaints in the leave vt handler
If we don't cancel the repaint, we end up pointlessly redrawing the output.
What's worse is that pageflipping to the new buffer eventually fails and
we miss the finish_frame callback, leaving the compositor stuck when we
re-enter the vt.
diff --git a/src/compositor.c b/src/compositor.c
index b6facd2..2e0a3f8 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -840,9 +840,8 @@
};
static void
-repaint(void *data, int msecs)
+repaint(struct weston_output *output, int msecs)
{
- struct weston_output *output = data;
struct weston_compositor *compositor = output->compositor;
struct weston_animation *animation, *next;
struct weston_frame_callback *cb, *cnext;
@@ -865,7 +864,11 @@
static void
idle_repaint(void *data)
{
- repaint(data, weston_compositor_get_time());
+ struct weston_output *output = data;
+
+ /* An idle repaint may have been cancelled by vt switching away. */
+ if (output->repaint_needed)
+ repaint(output, weston_compositor_get_time());
}
WL_EXPORT void