From 9f63ed94d42090a40ba27e55dd4673e050ef3bf2 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 28 Nov 2012 22:14:05 +0100 Subject: [PATCH] terminal: check swapping state during activation If a terminal gets activated while a swap-buffer operation is still in progress from the previous session, we must not directly reschedule it. Instead, we wait for the page-flip event and continue then. Signed-off-by: David Herrmann --- src/kmscon_terminal.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/kmscon_terminal.c b/src/kmscon_terminal.c index 6ebd7f9..9df5667 100644 --- a/src/kmscon_terminal.c +++ b/src/kmscon_terminal.c @@ -126,6 +126,22 @@ static void redraw_all(struct kmscon_terminal *term) } } +static void redraw_all_test(struct kmscon_terminal *term) +{ + struct shl_dlist *iter; + struct screen *scr; + + if (!term->awake) + return; + + shl_dlist_for_each(iter, &term->screens) { + scr = shl_dlist_entry(iter, struct screen, list); + if (uterm_display_is_swapping(scr->disp)) + scr->swapping = true; + redraw_screen(scr); + } +} + static void display_event(struct uterm_display *disp, struct uterm_display_event *ev, void *data) { @@ -440,7 +456,7 @@ static int session_event(struct kmscon_session *session, term->awake = true; if (!term->opened) terminal_open(term); - redraw_all(term); + redraw_all_test(term); break; case KMSCON_SESSION_DEACTIVATE: term->awake = false; -- 2.7.4