Patchwork fix sdl window resize

login
register
mail settings
Submitter Stefano Stabellini
Date Aug. 3, 2009, 3:10 p.m.
Message ID <alpine.DEB.2.00.0908031554350.12699@kaball-desktop>
Download mbox | patch
Permalink /patch/30600/
State Superseded
Headers show

Comments

Stefano Stabellini - Aug. 3, 2009, 3:10 p.m.
Hi all,
this patch fixes the sdl window resize event handler so that it doesn't
require the emulated graphic card (or console.c) to call
qemu_console_resize.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---
 sdl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Luiz Capitulino - Aug. 3, 2009, 9:22 p.m.
On Mon, 3 Aug 2009 16:10:43 +0100
Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:

> Hi all,
> this patch fixes the sdl window resize event handler so that it doesn't
> require the emulated graphic card (or console.c) to call
> qemu_console_resize.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

 This ones fixes the crash for me, thanks a lot.

Tested-by: Luiz Capitulino <lcapitulino@redhat.com>

Patch

diff --git a/sdl.c b/sdl.c
index 50a4a01..823afbb 100644
--- a/sdl.c
+++ b/sdl.c
@@ -720,6 +720,10 @@  static void sdl_refresh(DisplayState *ds)
                 bpp = 32;
             do_sdl_resize(rev->w, rev->h, bpp);
             scaling_active = 1;
+            if (!is_buffer_shared(ds->surface)) {
+                ds->surface = qemu_resize_displaysurface(ds, ds_get_width(ds), ds_get_height(ds));
+                dpy_resize(ds);
+            }
             vga_hw_invalidate();
             vga_hw_update();
             break;