All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ioemu: pump SDL events on resize
@ 2008-05-02 10:21 Samuel Thibault
  2008-05-02 10:23 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Thibault @ 2008-05-02 10:21 UTC (permalink / raw)
  To: xen-devel

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 <samuel.thibault@eu.citrix.com>

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:38:33 2008 +0100
@@ -294,6 +294,9 @@ static void sdl_resize(DisplayState *ds,
         };
 #endif
     }
+
+    /* Process any WM-generated resize event */
+    SDL_PumpEvents();
 }
 
 static void sdl_colourdepth(DisplayState *ds, int depth)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ioemu: pump SDL events on resize
  2008-05-02 10:21 [PATCH] ioemu: pump SDL events on resize Samuel Thibault
@ 2008-05-02 10:23 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2008-05-02 10:23 UTC (permalink / raw)
  To: xen-devel

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 <samuel.thibault@eu.citrix.com>

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());

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-02 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-02 10:21 [PATCH] ioemu: pump SDL events on resize Samuel Thibault
2008-05-02 10:23 ` Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.