From acbef47c5e5bdc6e692c3ccf471e1e8b73d897b6 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 24 Jun 2012 10:30:28 +0200 Subject: [PATCH] ui: enumerate displays on wakeup We might have missed a display when our handler was not registered, yet. So enumerate these displays on wakeup so we can be sure that we have all displays registered with the terminal subsystem. Signed-off-by: David Herrmann --- src/ui.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ui.c b/src/ui.c index 8c384c6..2f0216d 100644 --- a/src/ui.c +++ b/src/ui.c @@ -53,6 +53,7 @@ static void video_event(struct uterm_video *video, { struct kmscon_ui *ui = data; int ret; + struct uterm_display *disp; if (ev->action == UTERM_NEW) { if (uterm_display_get_state(ev->display) == UTERM_DISPLAY_INACTIVE) { @@ -64,6 +65,14 @@ static void video_event(struct uterm_video *video, return; } kmscon_terminal_add_display(ui->term, ev->display); + } else if (ev->action == UTERM_WAKE_UP) { + disp = uterm_video_get_displays(video); + while (disp) { + ev->display = disp; + ev->action = UTERM_NEW; + video_event(video, ev, data); + disp = uterm_display_next(disp); + } } }