terminal: avoid adding displays multiple times

We now enumerate displays on wake-up so we might end up adding a display
twice. This causes the display to be redrawn twice which is nasty so we
avoid it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-06-24 10:52:05 +02:00
parent 2757f1c691
commit 325412bc15

View File

@ -129,6 +129,12 @@ static int add_display(struct kmscon_terminal *term, struct uterm_display *disp)
struct screen *scr;
int ret;
unsigned int width, height;
struct screen *iter;
for (iter = term->screens; iter; iter = iter->next) {
if (iter->disp == disp)
return 0;
}
scr = malloc(sizeof(*scr));
if (!scr)