Re: [AD] windows redraw bug |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
[Sorry for the delay, it's rush hours lately on AD :-)]
> Using winxp, alleg 4.1.9wip (probably on 4.0.3 too)
>
> Hi, I just noticed that when using directdraw windowed mode in the same
> bpp than the desktop, when you move the window fast (and the option to
> move the whole window (not just the frame) is on), the window leaves some
> artifacts even after dropped.
I couldn't reproduce on Win98SE, 15-bit desktop, but WinXP is another beast.
> This doesn't appear in programs using double buffer, or in other bpps
> since the automatic conversion uses double buffer.
> This can be easily tested using a program that doesn't use double buffer,
> for example exswitch.
Well, the driver is also double-buffered when the colors match but we use
only DirectDraw to refresh, whereas we now switch to GDI under certain
circumstances when the colors don't match. This might be related.
> Anyway, the attached patch, that forces the window to redraw itself in
> each WM_MOVE message fixes the problem (tested).
> Note it uses RedrawWindow() since UpdateWindow() doesn't work because it
> doesn't invalidate the region.
What about the attached patch instead?
--
Eric Botcazou
--- /cvs/allegro/src/win/wddwin.c Mon Mar 3 19:46:52 2003
+++ allegro/src/win/wddwin.c Mon May 19 01:23:02 2003
@@ -177,6 +177,10 @@
xmod, xmod > 1 ? "ls" : "l", x > 0 ? "left" : "right");
}
}
+ else {
+ /* JG: avoid artifacts when moving fast the window on WinXP. */
+ InvalidateRect(allegro_wnd, NULL, FALSE);
+ }
}