From d2e1f7d505e6cd7bac14667c3696cd159ca7aee1 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Mon, 26 Dec 2011 12:15:48 +0100 Subject: [PATCH] console: do not resize buffer if size doesn't change We shouldn't do anything if buffer_resize is called with the same size. This also suppresses useless "buffer resized to XxY" debug messages. Signed-off-by: David Herrmann --- src/console_cell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/console_cell.c b/src/console_cell.c index 85a20a0..75c2180 100644 --- a/src/console_cell.c +++ b/src/console_cell.c @@ -345,6 +345,9 @@ int kmscon_buffer_resize(struct kmscon_buffer *buf, unsigned int x, if (!y) y = DEFAULT_HEIGHT; + if (buf->size_x == x && buf->size_y == y) + return 0; + /* Resize y size by adjusting the current buffer size */ if (y < buf->size_y) { /*