]> xenbits.xensource.com Git - xen.git/commitdiff
ioemu: pump SDL events on resize
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 2 May 2008 12:47:46 +0000 (13:47 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 2 May 2008 12:47:46 +0000 (13:47 +0100)
When sdl_resize resizes the SDL window, some window manager send back
a ConfigureNotify event, which triggers a SDL_VIDEORESIZE event. That
event, however, is seen only much later, on the next VGA refresh
round. If the guest quickly switches to another resolution in between,
the SDL_VIDEORESIZE event makes us erroneously rescale that new
resolution into the old one.

This patch makes us pump that window manager event, so that no
SDL_VIDEORESIZE event is generated.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
tools/ioemu/sdl.c

index 536e9f480fa41b7cb5f3bedb88e77dd5a5bd9c74..c70c3cb7ad7fd74ff97adb6ce194774c081f6b8f 100644 (file)
@@ -235,6 +235,9 @@ static void sdl_resize(DisplayState *ds, int w, int h, int linesize)
  again:
     screen = SDL_SetVideoMode(w, h, 0, flags);
 
+    /* Process any WM-generated resize event */
+    SDL_PumpEvents();
+
     if (!screen) {
         fprintf(stderr, "Could not open SDL display: %s\n", SDL_GetError());
         if (opengl_enabled) {