From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH] ioemu: pump SDL events on resize Date: Fri, 2 May 2008 11:23:08 +0100 Message-ID: <20080502102308.GB4819@implementation.uk.xensource.com> References: <20080502102133.GA4819@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20080502102133.GA4819@implementation.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org Samuel Thibault, le Fri 02 May 2008 11:21:33 +0100, a écrit : > ioemu: pump SDL events on resize > > 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 Oops, I sent an old patch, here is a proper one: diff -r 7190027c2da8 tools/ioemu/sdl.c --- a/tools/ioemu/sdl.c Thu May 01 18:56:04 2008 +0100 +++ b/tools/ioemu/sdl.c Fri May 02 10:47:36 2008 +0100 @@ -235,6 +235,9 @@ static void sdl_resize(DisplayState *ds, 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());