]> git.proxmox.com Git - mirror_qemu.git/commitdiff
console: fix console resize
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 24 Jan 2017 11:10:39 +0000 (12:10 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 31 Jan 2017 15:09:16 +0000 (16:09 +0100)
Only skip surface reallocation in case the old surface was created using
qemu_alloc_display (via qemu_create_displaysurface) too, otherwise we
might end up with a DisplaySurface with the wrong backing storage.

Cc: 1658634@bugs.launchpad.net
Fixes: cd958edb1fae85d0c7d1e1acbff82d22724e8d64
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1485256239-12219-1-git-send-email-kraxel@redhat.com

ui/console.c

index fe03a666f714b270d38332ec92937f194f1171ac..e353c856817d13c78b02e289ec58f02994f82f2b 100644 (file)
@@ -2116,7 +2116,7 @@ void qemu_console_resize(QemuConsole *s, int width, int height)
 
     assert(s->console_type == GRAPHIC_CONSOLE);
 
-    if (s->surface &&
+    if (s->surface && (s->surface->flags & QEMU_ALLOCATED_FLAG) &&
         pixman_image_get_width(s->surface->image) == width &&
         pixman_image_get_height(s->surface->image) == height) {
         return;