diff mbox

console: console_select: check for nop

Message ID 1318345120-22614-1-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy Oct. 11, 2011, 2:58 p.m. UTC
Signed-off-by: Alon Levy <alevy@redhat.com>
---
qxl screen_dump is broken since f81bdefb6. That commit didn't introduce
the problem, the problem is in qxl. But I've not managed to figure out
the real problem yet. This patch works around it, but in a nice way - if
you only have a single console or never set the other consoles active
then there will not be a displaysurface reallocation which is the cause
of the wrong rendering.

To see rendering errors, run with sdl and spice, then do a screen dump.
 The sdl screen will be updated with zeros (not quite - it's pointing at
 a wrong location that is almost but not totally zeroed).

 console.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/console.c b/console.c
index e43de92..7f0900f 100644
--- a/console.c
+++ b/console.c
@@ -1067,6 +1067,9 @@  void console_select(unsigned int index)
 
     if (index >= MAX_CONSOLES)
         return;
+    if (active_console == consoles[index]) {
+        return;
+    }
     if (active_console) {
         active_console->g_width = ds_get_width(active_console->ds);
         active_console->g_height = ds_get_height(active_console->ds);